diff options
author | julian <julian@FreeBSD.org> | 1996-11-13 01:45:56 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1996-11-13 01:45:56 +0000 |
commit | 3781f2dcb04f4f320bf7b51a32450154bf7d7030 (patch) | |
tree | cd2c79516c632966d2aec6c5bdb46adaee2ca904 /sys | |
parent | bb604e6a0ab4ad59b5056ced604449912e9b30b3 (diff) | |
download | FreeBSD-src-3781f2dcb04f4f320bf7b51a32450154bf7d7030.zip FreeBSD-src-3781f2dcb04f4f320bf7b51a32450154bf7d7030.tar.gz |
Submitted by: Archie and me.
We encountered an interesting situation where the superblock for
a file system got written to disk with the "fs_fmod" flag set to
one. It appears that this flag is normally supposed to be cleared
during ffs_sync(), but we experienced a crash, or some other weird
occurrence that left it on the disk set to 1.
Later this partition was mounted read-only... and the fs_fmod
field was never cleared, causing ffs_sync() to panic "rofs mod"
when trying to unmount that filesystem (ffs_vfsops.c: line 790).
fix:
set this bit to 0 when you load the superblock from disk.
(see more complete mail on this to hackers)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index a35502a..e785086 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94 - * $Id: ffs_vfsops.c,v 1.40 1996/08/21 21:56:09 dyson Exp $ + * $Id: ffs_vfsops.c,v 1.41 1996/09/07 17:34:57 dyson Exp $ */ #include "opt_quota.h" @@ -383,6 +383,7 @@ ffs_reload(mp, cred, p) if (error) return (error); fs = (struct fs *)bp->b_data; + fs->fs_fmod = 0; if (fs->fs_magic != FS_MAGIC || fs->fs_bsize > MAXBSIZE || fs->fs_bsize < sizeof(struct fs)) { brelse(bp); @@ -511,6 +512,7 @@ ffs_mountfs(devvp, mp, p) error = EINVAL; /* XXX needs translation */ goto out; } + fs->fs_fmod = 0; if (!fs->fs_clean) { if (ronly || (mp->mnt_flag & MNT_FORCE)) { printf("WARNING: %s was not properly dismounted.\n",fs->fs_fsmnt); |