From a802c35eb4beea451e9fea598128fb06b96e1aae Mon Sep 17 00:00:00 2001 From: tegge Date: Tue, 26 Sep 2006 04:18:36 +0000 Subject: Don't restore MNT_QUOTA bit in mnt_flag after a failed mount with MNT_UPDATE flag, closing a race between nmount() and quotactl(). --- sys/kern/vfs_mount.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index db40943..543f7e4 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -982,7 +982,8 @@ vfs_domount( mp->mnt_flag &= ~(MNT_UPDATE | MNT_RELOAD | MNT_FORCE | MNT_SNAPSHOT); if (error) - mp->mnt_flag = flag; + mp->mnt_flag = (mp->mnt_flag & MNT_QUOTA) | + (flag & ~MNT_QUOTA); if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) mp->mnt_kern_flag |= MNTK_ASYNC; else -- cgit v1.1