diff options
author | 2007-04-11 15:17:46 +0000 | |
---|---|---|
committer | 2007-04-11 15:17:46 +0000 | |
commit | d8fbcc76d1dc7af2f3414061af701ddadd16b7d5 (patch) | |
tree | 7b3c81b427227b978473b11eeffc3b772e460fa1 | |
parent | Don't use m_prepend() even if it is used mostly correct here. (diff) | |
download | wireguard-openbsd-d8fbcc76d1dc7af2f3414061af701ddadd16b7d5.tar.xz wireguard-openbsd-d8fbcc76d1dc7af2f3414061af701ddadd16b7d5.zip |
in ffs_reload() use ffs_validate() to check if the
superblock is OK; Makes it work for FFS2.
ok tedu@
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 0490c992cfa..f1bee59ccf9 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.102 2007/03/31 15:30:07 pedro Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.103 2007/04/11 15:17:46 thib Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -560,11 +560,9 @@ ffs_reload(struct mount *mountp, struct ucred *cred, struct proc *p) } newfs = (struct fs *)bp->b_data; - if (newfs->fs_magic != FS_MAGIC || (u_int)newfs->fs_bsize > MAXBSIZE || - newfs->fs_bsize < sizeof(struct fs) || - (u_int)newfs->fs_sbsize > SBSIZE) { + if (ffs_validate(newfs) == 0) { brelse(bp); - return (EIO); /* XXX needs translation */ + return (EINVAL); } fs = VFSTOUFS(mountp)->um_fs; /* |