summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-11-22 06:10:36 +0000
committerbde <bde@FreeBSD.org>1997-11-22 06:10:36 +0000
commit7b2acd5a85bb1356335f2de400afbd2add858c67 (patch)
treeb5109d72111665c35a46951872783f285f5059bb /sys/kern/vfs_extattr.c
parent9475f7b51ac8cf64dbd67c1b56265c47e9d569de (diff)
downloadFreeBSD-src-7b2acd5a85bb1356335f2de400afbd2add858c67.zip
FreeBSD-src-7b2acd5a85bb1356335f2de400afbd2add858c67.tar.gz
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.
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r--sys/kern/vfs_extattr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index eb8cb4e..8a0ab1d 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)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)
mp->mnt_flag &= ~MNT_RDONLY;
mp->mnt_flag &=~ (MNT_UPDATE | MNT_RELOAD | MNT_FORCE);
- mp->mnt_kern_flag &=~ (MNTK_WANTRDWR);
- if (error)
+ mp->mnt_kern_flag &=~ MNTK_WANTRDWR;
+ if (error) {
mp->mnt_flag = flag;
mp->mnt_kern_flag = flag2;
+ }
vfs_unbusy(mp, p);
return (error);
}
OpenPOWER on IntegriCloud