diff options
author | kib <kib@FreeBSD.org> | 2008-09-16 10:59:35 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-09-16 10:59:35 +0000 |
commit | ad287e3d61bd9ac5dc16f705f511e471510755c4 (patch) | |
tree | 0c1aefb887730cb30f6ad3f69a31afea67c3932f /sys/ufs/ffs | |
parent | f67f57a431df0cebe903f455fbe18bc08a370359 (diff) | |
download | FreeBSD-src-ad287e3d61bd9ac5dc16f705f511e471510755c4.zip FreeBSD-src-ad287e3d61bd9ac5dc16f705f511e471510755c4.tar.gz |
When downgrading the read-write mount to read-only, do_unmount() sets
MNT_RDONLY flag before the VFS_MOUNT() is called. In ufs_inactive()
and ufs_itimes_locked(), UFS verifies whether the fs is read-only by
checking MNT_RDONLY, but this may cause loss of the IN_MODIFIED flag
for inode on the fs being remounted rw->ro.
Introduce UFS_RDONLY() struct ufsmount' method that reports the value
of the fs_ronly. The later is set to 1 only after the remount is
finished.
Reviewed by: tegge
In collaboration with: pho
MFC after: 1 month
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_extern.h | 2 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_inode.c | 8 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 22afbaa..d5dfa12 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -131,4 +131,6 @@ int softdep_process_worklist(struct mount *, int); int softdep_fsync(struct vnode *); int softdep_waitidle(struct mount *); +int ffs_rdonly(struct inode *); + #endif /* !_UFS_FFS_EXTERN_H */ diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 0a9bc9d..4c58e41 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -646,3 +646,11 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) *countp = blocksreleased; return (allerror); } + +int +ffs_rdonly(struct inode *ip) +{ + + return (ip->i_ump->um_fs->fs_ronly != 0); +} + diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 91cd7cf..67d4496 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -734,6 +734,7 @@ ffs_mountfs(devvp, mp, td) ump->um_valloc = ffs_valloc; ump->um_vfree = ffs_vfree; ump->um_ifree = ffs_ifree; + ump->um_rdonly = ffs_rdonly; mtx_init(UFS_MTX(ump), "FFS", "FFS Lock", MTX_DEF); bcopy(bp->b_data, ump->um_fs, (u_int)fs->fs_sbsize); if (fs->fs_sbsize < SBLOCKSIZE) |