Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/union The directory vnode must be locked before we ca...



details:   https://anonhg.NetBSD.org/src/rev/9238394f9879
branches:  trunk
changeset: 755951:9238394f9879
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed Jun 30 13:10:35 2010 +0000

description:
The directory vnode must be locked before we call VOP_WHITEOUT().

Should fix PR #23986 "problem mounting directories".

diffstat:

 sys/fs/union/union_vfsops.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r b21ab9d3a058 -r 9238394f9879 sys/fs/union/union_vfsops.c
--- a/sys/fs/union/union_vfsops.c       Wed Jun 30 11:08:12 2010 +0000
+++ b/sys/fs/union/union_vfsops.c       Wed Jun 30 13:10:35 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: union_vfsops.c,v 1.61 2010/01/08 11:35:09 pooka Exp $  */
+/*     $NetBSD: union_vfsops.c,v 1.62 2010/06/30 13:10:35 hannken Exp $        */
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.61 2010/01/08 11:35:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.62 2010/06/30 13:10:35 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -208,7 +208,10 @@
         * supports whiteout operations
         */
        if ((mp->mnt_flag & MNT_RDONLY) == 0) {
-               error = VOP_WHITEOUT(um->um_uppervp, (struct componentname *) 0, LOOKUP);
+               vn_lock(um->um_uppervp, LK_EXCLUSIVE | LK_RETRY);
+               error = VOP_WHITEOUT(um->um_uppervp,
+                   (struct componentname *) 0, LOOKUP);
+               VOP_UNLOCK(um->um_uppervp);
                if (error)
                        goto bad;
        }



Home | Main Index | Thread Index | Old Index