Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ufs Explain why the lock in here needs to be recursi...



details:   https://anonhg.NetBSD.org/src/rev/7015ebcfff67
branches:  trunk
changeset: 348810:7015ebcfff67
user:      dholland <dholland%NetBSD.org@localhost>
date:      Wed Nov 09 05:08:35 2016 +0000

description:
Explain why the lock in here needs to be recursive. Related to PR 46997.

diffstat:

 sys/ufs/ufs/ufs_extattr.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 9b7e3f5131dd -r 7015ebcfff67 sys/ufs/ufs/ufs_extattr.c
--- a/sys/ufs/ufs/ufs_extattr.c Wed Nov 09 04:12:55 2016 +0000
+++ b/sys/ufs/ufs/ufs_extattr.c Wed Nov 09 05:08:35 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_extattr.c,v 1.47 2016/07/07 06:55:44 msaitoh Exp $ */
+/*     $NetBSD: ufs_extattr.c,v 1.48 2016/11/09 05:08:35 dholland 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.47 2016/07/07 06:55:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_extattr.c,v 1.48 2016/11/09 05:08:35 dholland Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ffs.h"
@@ -168,7 +168,13 @@
 ufs_extattr_uepm_lock(struct ufsmount *ump)
 {
 
-       /* XXX Why does this need to be recursive? */
+       /*
+        * XXX This needs to be recursive for the following reasons:
+        *   - it is taken in ufs_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