From 83154f853d9ca39deb1add01e032aff1f0678514 Mon Sep 17 00:00:00 2001 From: tegge Date: Tue, 26 Sep 2006 04:12:49 +0000 Subject: 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(). --- sys/fs/devfs/devfs_vfsops.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/fs/devfs/devfs_vfsops.c') diff --git a/sys/fs/devfs/devfs_vfsops.c b/sys/fs/devfs/devfs_vfsops.c index 8c1069a..f3a364b 100644 --- a/sys/fs/devfs/devfs_vfsops.c +++ b/sys/fs/devfs/devfs_vfsops.c @@ -79,11 +79,13 @@ devfs_mount(struct mount *mp, struct thread *td) sx_init(&fmp->dm_lock, "devfsmount"); fmp->dm_holdcnt = 1; + MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; mp->mnt_kern_flag |= MNTK_MPSAFE; #ifdef MAC mp->mnt_flag |= MNT_MULTILABEL; #endif + MNT_IUNLOCK(mp); fmp->dm_mount = mp; mp->mnt_data = (void *) fmp; vfs_getnewfsid(mp); -- cgit v1.1