Don't restore mnt_kern_flag on failed MNT_UPDATE mount, it can race

with dounmount(), causing loss of MNTK_UNMOUNT flag.
This commit is contained in:
Tor Egge 2006-09-26 04:15:04 +00:00
parent 5da56ddb21
commit cea9d840d8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=162648

View File

@ -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)