diff options
author | tegge <tegge@FreeBSD.org> | 2006-09-26 04:15:04 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2006-09-26 04:15:04 +0000 |
commit | b500b0ae92746b6a7309c0f88afadb7c588fd859 (patch) | |
tree | 62600e9c42382f8a52c2736bf5e0e5f37dd08829 /sys | |
parent | 83154f853d9ca39deb1add01e032aff1f0678514 (diff) | |
download | FreeBSD-src-b500b0ae92746b6a7309c0f88afadb7c588fd859.zip FreeBSD-src-b500b0ae92746b6a7309c0f88afadb7c588fd859.tar.gz |
Don't restore mnt_kern_flag on failed MNT_UPDATE mount, it can race
with dounmount(), causing loss of MNTK_UNMOUNT flag.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_mount.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 1e4cf6d..f99b083 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -790,7 +790,7 @@ vfs_domount( struct mount *mp; struct vfsconf *vfsp; struct export_args export; - int error, flag = 0, kern_flag = 0; + int error, flag = 0; struct vattr va; struct nameidata nd; @@ -852,7 +852,6 @@ vfs_domount( mp = vp->v_mount; MNT_ILOCK(mp); flag = mp->mnt_flag; - kern_flag = mp->mnt_kern_flag; /* * We only allow the filesystem to be reloaded if it * is currently mounted read-only. @@ -980,10 +979,8 @@ vfs_domount( MNT_ILOCK(mp); mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | MNT_SNAPSHOT); - if (error) { + if (error) mp->mnt_flag = flag; - mp->mnt_kern_flag = kern_flag; - } MNT_IUNLOCK(mp); if ((mp->mnt_flag & MNT_RDONLY) == 0) { if (mp->mnt_syncer == NULL) |