Module Name:    src
Committed By:   bouyer
Date:           Sat Jun 18 16:22:31 UTC 2011

Modified Files:
        src/sys/ufs/ufs [netbsd-5]: ufs_extattr.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1624):
        sys/ufs/ufs/ufs_extattr.c: revision 1.29 via patch
Fix filesystem root leaked lock when using UFS_EXTATTR_AUTOSTART.
This way, statvfs(2) calls obtained by df(1) or umount(8) will no
longer sleep forever in the kernel to acquire the lock.


To generate a diff of this commit:
cvs rdiff -u -r1.21.14.1 -r1.21.14.2 src/sys/ufs/ufs/ufs_extattr.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/ufs/ufs/ufs_extattr.c
diff -u src/sys/ufs/ufs/ufs_extattr.c:1.21.14.1 src/sys/ufs/ufs/ufs_extattr.c:1.21.14.2
--- src/sys/ufs/ufs/ufs_extattr.c:1.21.14.1	Fri May 20 19:30:09 2011
+++ src/sys/ufs/ufs/ufs_extattr.c	Sat Jun 18 16:22:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_extattr.c,v 1.21.14.1 2011/05/20 19:30:09 bouyer Exp $	*/
+/*	$NetBSD: ufs_extattr.c,v 1.21.14.2 2011/06/18 16:22:31 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1999-2002 Robert N. M. Watson
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_extattr.c,v 1.21.14.1 2011/05/20 19:30:09 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_extattr.c,v 1.21.14.2 2011/06/18 16:22:31 bouyer Exp $");
 
 #include "opt_ffs.h"
 
@@ -284,7 +284,8 @@
 	error = ufs_lookup(&vargs);
 	PNBUF_PUT(cnp.cn_pnbuf);
 	if (error) {
-		VOP_UNLOCK(start_dvp, 0);
+		if (lockparent == 0)
+			VOP_UNLOCK(start_dvp, 0);
 		return (error);
 	}
 #if 0
@@ -292,6 +293,10 @@
 		panic("ufs_extattr_lookup: target_vp == start_dvp");
 #endif
 
+	if ((target_vp != start_dvp) && (lockparent == 0))
+		VOP_UNLOCK(start_dvp, 0);
+
+
 	KASSERT(VOP_ISLOCKED(target_vp) == LK_EXCLUSIVE);
 	*vp = target_vp;
 	return (0);

Reply via email to