Module Name: src Committed By: hannken Date: Wed Jun 30 13:10:35 UTC 2010
Modified Files: src/sys/fs/union: union_vfsops.c Log Message: The directory vnode must be locked before we call VOP_WHITEOUT(). Should fix PR #23986 "problem mounting directories". To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/fs/union/union_vfsops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/fs/union/union_vfsops.c diff -u src/sys/fs/union/union_vfsops.c:1.61 src/sys/fs/union/union_vfsops.c:1.62 --- src/sys/fs/union/union_vfsops.c:1.61 Fri Jan 8 11:35:09 2010 +++ src/sys/fs/union/union_vfsops.c Wed Jun 30 13:10:35 2010 @@ -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; }