Module Name:    src
Committed By:   dholland
Date:           Wed Nov  9 05:44:42 UTC 2016

Modified Files:
        src/sys/ufs/lfs: ulfs_extattr.c

Log Message:
Apply ufs_extattr.c 1.48:
Explain why the lock in here needs to be recursive. Related to PR 46997.

ufs_extattr 1.47 was also committed directly here, so this file is still
fully synced with it.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/ufs/lfs/ulfs_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/lfs/ulfs_extattr.c
diff -u src/sys/ufs/lfs/ulfs_extattr.c:1.13 src/sys/ufs/lfs/ulfs_extattr.c:1.14
--- src/sys/ufs/lfs/ulfs_extattr.c:1.13	Thu Jul  7 06:55:44 2016
+++ src/sys/ufs/lfs/ulfs_extattr.c	Wed Nov  9 05:44:42 2016
@@ -1,5 +1,5 @@
-/*	$NetBSD: ulfs_extattr.c,v 1.13 2016/07/07 06:55:44 msaitoh Exp $	*/
-/*  from NetBSD: ufs_extattr.c,v 1.46 2014/11/19 16:26:47 manu Exp  */
+/*	$NetBSD: ulfs_extattr.c,v 1.14 2016/11/09 05:44:42 dholland Exp $	*/
+/*  from NetBSD: ulfs_extattr.c,v 1.48 2016/11/09 05:08:35 dholland Exp  */
 
 /*-
  * Copyright (c) 1999-2002 Robert N. M. Watson
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ulfs_extattr.c,v 1.13 2016/07/07 06:55:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ulfs_extattr.c,v 1.14 2016/11/09 05:44:42 dholland Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_lfs.h"
@@ -168,7 +168,13 @@ static void
 ulfs_extattr_uepm_lock(struct ulfsmount *ump)
 {
 
-	/* XXX Why does this need to be recursive? */
+	/*
+	 * XXX This needs to be recursive for the following reasons:
+	 *   - it is taken in ulfs_extattr_vnode_inactive
+	 *   - which is called from VOP_INACTIVE
+	 *   - which can be triggered by any vrele, vput, or vn_close
+	 *   - several of these can happen while it's held
+	 */
 	if (mutex_owned(&ump->um_extattr.uepm_lock)) {
 		ump->um_extattr.uepm_lockcnt++;
 		return;

Reply via email to