mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
Fixed rev.1.81. mp->mnt_kern_flag was restored in the non-error case of
`mount -u'. This only matters for `mount -u' competing with unmounts. If I understand the locking correctly: if mount() blocks, then unmount() may run and set mp->kern_flag for the same mp. Then unmount() blocks waiting for mount() to finish. When unmount() continues, its MNTK flags (MNTK_UNMOUNT and MNTK_MWAIT) may have been clobbered. Didn't fix old bugs: - restoring mp->mnt_kern_flag is wrong for the same reasons in the error case. - the error case of unmount() seems to be broken too: (a) MNTK_UNMOUNT gets clobbered, although another unmount() may have set it. Perhaps it shouldn't be set until after the full lock is aquired. (b) MNTK_MWAIT isn't honoured. Fixed a nearby style bug.
This commit is contained in:
parent
ac4c6ef8a9
commit
d02601f8cf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31345
@ -36,7 +36,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||||
* $Id: vfs_syscalls.c,v 1.81 1997/11/12 05:42:17 julian Exp $
|
* $Id: vfs_syscalls.c,v 1.82 1997/11/13 00:28:50 julian Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -274,10 +274,11 @@ update:
|
|||||||
if (mp->mnt_kern_flag & MNTK_WANTRDWR)
|
if (mp->mnt_kern_flag & MNTK_WANTRDWR)
|
||||||
mp->mnt_flag &= ~MNT_RDONLY;
|
mp->mnt_flag &= ~MNT_RDONLY;
|
||||||
mp->mnt_flag &=~ (MNT_UPDATE | MNT_RELOAD | MNT_FORCE);
|
mp->mnt_flag &=~ (MNT_UPDATE | MNT_RELOAD | MNT_FORCE);
|
||||||
mp->mnt_kern_flag &=~ (MNTK_WANTRDWR);
|
mp->mnt_kern_flag &=~ MNTK_WANTRDWR;
|
||||||
if (error)
|
if (error) {
|
||||||
mp->mnt_flag = flag;
|
mp->mnt_flag = flag;
|
||||||
mp->mnt_kern_flag = flag2;
|
mp->mnt_kern_flag = flag2;
|
||||||
|
}
|
||||||
vfs_unbusy(mp, p);
|
vfs_unbusy(mp, p);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||||
* $Id: vfs_syscalls.c,v 1.81 1997/11/12 05:42:17 julian Exp $
|
* $Id: vfs_syscalls.c,v 1.82 1997/11/13 00:28:50 julian Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -274,10 +274,11 @@ update:
|
|||||||
if (mp->mnt_kern_flag & MNTK_WANTRDWR)
|
if (mp->mnt_kern_flag & MNTK_WANTRDWR)
|
||||||
mp->mnt_flag &= ~MNT_RDONLY;
|
mp->mnt_flag &= ~MNT_RDONLY;
|
||||||
mp->mnt_flag &=~ (MNT_UPDATE | MNT_RELOAD | MNT_FORCE);
|
mp->mnt_flag &=~ (MNT_UPDATE | MNT_RELOAD | MNT_FORCE);
|
||||||
mp->mnt_kern_flag &=~ (MNTK_WANTRDWR);
|
mp->mnt_kern_flag &=~ MNTK_WANTRDWR;
|
||||||
if (error)
|
if (error) {
|
||||||
mp->mnt_flag = flag;
|
mp->mnt_flag = flag;
|
||||||
mp->mnt_kern_flag = flag2;
|
mp->mnt_kern_flag = flag2;
|
||||||
|
}
|
||||||
vfs_unbusy(mp, p);
|
vfs_unbusy(mp, p);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user