diff options
author | Pedro Martelletto <pedro@cvs.openbsd.org> | 2006-03-31 12:55:05 +0000 |
---|---|---|
committer | Pedro Martelletto <pedro@cvs.openbsd.org> | 2006-03-31 12:55:05 +0000 |
commit | 948dab4313eca6ad4c00d7b870cbd396e69b8103 (patch) | |
tree | 6876b0ce015f6eadd1ba4d2909fd93eb91ea7b3b /sys/ufs | |
parent | d23b5f336dc3c989ba37bf525b95ff0ab7634b63 (diff) |
ffs_statfs() should not panic on FFS2 file systems
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index c2821ac0a5a..0e1accb26a4 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.85 2006/03/31 12:45:01 pedro Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.86 2006/03/31 12:55:04 pedro Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -1045,8 +1045,15 @@ ffs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p) ump = VFSTOUFS(mp); fs = ump->um_fs; + +#ifdef FFS2 + if (fs->fs_magic != FS_MAGIC && fs->fs_magic != FS_UFS2_MAGIC) + panic("ffs_statfs"); +#else if (fs->fs_magic != FS_MAGIC) panic("ffs_statfs"); +#endif /* FFS2 */ + sbp->f_bsize = fs->fs_fsize; sbp->f_iosize = fs->fs_bsize; sbp->f_blocks = fs->fs_dsize; |