From 89e48410c4a9bc3d1addefd54eea5092ca6041af Mon Sep 17 00:00:00 2001 From: pooka Date: Tue, 4 Sep 2007 00:11:38 +0000 Subject: [PATCH] * don't allow the file server to specify a node size to be VSIZENOTSET * KASSERT that VNOVAL == VSIZENOTSET --- sys/fs/puffs/puffs_subr.c | 6 ++++-- sys/fs/puffs/puffs_vfsops.c | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/fs/puffs/puffs_subr.c b/sys/fs/puffs/puffs_subr.c index 5831f4e1d72f..5d775df56b0f 100644 --- a/sys/fs/puffs/puffs_subr.c +++ b/sys/fs/puffs/puffs_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_subr.c,v 1.44 2007/08/01 14:20:45 pooka Exp $ */ +/* $NetBSD: puffs_subr.c,v 1.45 2007/09/04 00:11:38 pooka Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_subr.c,v 1.44 2007/08/01 14:20:45 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_subr.c,v 1.45 2007/09/04 00:11:38 pooka Exp $"); #include #include @@ -87,6 +87,8 @@ puffs_getvnode(struct mount *mp, void *cookie, enum vtype type, if (type <= VNON || type >= VBAD) return EINVAL; + if (vsize == VSIZENOTSET) + return EINVAL; pmp = MPTOPUFFSMP(mp); diff --git a/sys/fs/puffs/puffs_vfsops.c b/sys/fs/puffs/puffs_vfsops.c index 6c4b78fb7493..cd558bc23606 100644 --- a/sys/fs/puffs/puffs_vfsops.c +++ b/sys/fs/puffs/puffs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_vfsops.c,v 1.54 2007/08/23 14:36:48 pooka Exp $ */ +/* $NetBSD: puffs_vfsops.c,v 1.55 2007/09/04 00:11:38 pooka Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.54 2007/08/23 14:36:48 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.55 2007/09/04 00:11:38 pooka Exp $"); #include #include @@ -87,6 +87,9 @@ puffs_mount(struct mount *mp, const char *path, void *data, size_t *data_len, if (mp->mnt_flag & MNT_UPDATE) return EOPNOTSUPP; + /* some checks depend on this */ + KASSERT(VNOVAL == VSIZENOTSET); + /* * We need the file system name */