Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs Apply ufs_extattr.c 1.48:



details:   https://anonhg.NetBSD.org/src/rev/50f0f4378303
branches:  trunk
changeset: 348811:50f0f4378303
user:      dholland <dholland%NetBSD.org@localhost>
date:      Wed Nov 09 05:44:42 2016 +0000

description:
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.

diffstat:

 sys/ufs/lfs/ulfs_extattr.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 7015ebcfff67 -r 50f0f4378303 sys/ufs/lfs/ulfs_extattr.c
--- a/sys/ufs/lfs/ulfs_extattr.c        Wed Nov 09 05:08:35 2016 +0000
+++ b/sys/ufs/lfs/ulfs_extattr.c        Wed Nov 09 05:44:42 2016 +0000
@@ -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 @@
 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;



Home | Main Index | Thread Index | Old Index