summaryrefslogtreecommitdiffstats
path: root/sys/fs/hpfs
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>2006-09-26 04:12:49 +0000
committertegge <tegge@FreeBSD.org>2006-09-26 04:12:49 +0000
commit83154f853d9ca39deb1add01e032aff1f0678514 (patch)
treeac46e0b5a80f88127d3d14dc940a5f2746573c00 /sys/fs/hpfs
parentd7fe3e736512a1dd37a985037184eecf7df1f26d (diff)
downloadFreeBSD-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/fs/hpfs')
-rw-r--r--sys/fs/hpfs/hpfs_vfsops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c
index cc43fe6..92735ec 100644
--- a/sys/fs/hpfs/hpfs_vfsops.c
+++ b/sys/fs/hpfs/hpfs_vfsops.c
@@ -315,7 +315,9 @@ hpfs_mountfs(devvp, mp, td)
mp->mnt_stat.f_fsid.val[0] = (long)dev2udev(dev);
mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum;
mp->mnt_maxsymlinklen = 0;
+ MNT_ILOCK(mp);
mp->mnt_flag |= MNT_LOCAL;
+ MNT_IUNLOCK(mp);
return (0);
failed:
@@ -359,7 +361,9 @@ hpfs_unmount(
hpfs_cpdeinit(hpmp);
hpfs_bmdeinit(hpmp);
mp->mnt_data = (qaddr_t)0;
+ MNT_ILOCK(mp);
mp->mnt_flag &= ~MNT_LOCAL;
+ MNT_IUNLOCK(mp);
FREE(hpmp, M_HPFSMNT);
return (0);
OpenPOWER on IntegriCloud