diff options
author | tegge <tegge@FreeBSD.org> | 2006-09-26 04:12:49 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2006-09-26 04:12:49 +0000 |
commit | 83154f853d9ca39deb1add01e032aff1f0678514 (patch) | |
tree | ac46e0b5a80f88127d3d14dc940a5f2746573c00 /sys/gnu/fs/reiserfs/reiserfs_vfsops.c | |
parent | d7fe3e736512a1dd37a985037184eecf7df1f26d (diff) | |
download | FreeBSD-src-83154f853d9ca39deb1add01e032aff1f0678514.zip FreeBSD-src-83154f853d9ca39deb1add01e032aff1f0678514.tar.gz |
Use mount interlock to protect all changes to mnt_flag and mnt_kern_flag.
This eliminates a race where MNT_UPDATE flag could be lost when nmount()
raced against sync(), sync_fsync() or quotactl().
Diffstat (limited to 'sys/gnu/fs/reiserfs/reiserfs_vfsops.c')
-rw-r--r-- | sys/gnu/fs/reiserfs/reiserfs_vfsops.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/gnu/fs/reiserfs/reiserfs_vfsops.c b/sys/gnu/fs/reiserfs/reiserfs_vfsops.c index b6436ae..066d5b2 100644 --- a/sys/gnu/fs/reiserfs/reiserfs_vfsops.c +++ b/sys/gnu/fs/reiserfs/reiserfs_vfsops.c @@ -241,7 +241,9 @@ reiserfs_unmount(struct mount *mp, int mntflags, struct thread *td) } mp->mnt_data = (qaddr_t)0; + MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_LOCAL; + MNT_IUNLOCK(mp); reiserfs_log(LOG_DEBUG, "done\n"); return (error); @@ -624,7 +626,9 @@ reiserfs_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td) mp->mnt_data = (qaddr_t)rmp; mp->mnt_stat.f_fsid.val[0] = dev2udev(dev); mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; + MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; + MNT_IUNLOCK(mp); #if defined(si_mountpoint) devvp->v_rdev->si_mountpoint = mp; #endif |