Source-Changes-HG archive

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

[src-draft/trunk]: src-draft/sys Print a warning for non-mpsafe vnodes



details:   https://anonhg.NetBSD.org/src-draft/rev/64492f9bfebc
branches:  trunk
changeset: 931618:64492f9bfebc
user:      Joerg Sonnenberger <joerg%bec.de@localhost>
date:      Thu Dec 26 23:36:07 2019 +0100

description:
Print a warning for non-mpsafe vnodes

diffstat:

 sys/kern/vnode_if.c |  5 +++++
 sys/sys/vnode.h     |  1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diffs (26 lines):

diff -r d5c80cb3cb5a -r 64492f9bfebc sys/kern/vnode_if.c
--- a/sys/kern/vnode_if.c       Thu Dec 26 23:35:18 2019 +0100
+++ b/sys/kern/vnode_if.c       Thu Dec 26 23:36:07 2019 +0100
@@ -86,6 +86,11 @@
                *mp = vp->v_mount;
        }
 
+       if (!*mpsafe && !(vp->v_vflag & VV_NONMPSAFE)) {
+               vp->v_vflag |= VV_NONMPSAFE;
+               printf("vnode %p on mount point %p is not mpsafe\n", vp, *mp);
+       }
+
        return 0;
 }
 
diff -r d5c80cb3cb5a -r 64492f9bfebc sys/sys/vnode.h
--- a/sys/sys/vnode.h   Thu Dec 26 23:35:18 2019 +0100
+++ b/sys/sys/vnode.h   Thu Dec 26 23:36:07 2019 +0100
@@ -201,6 +201,7 @@
 #define        VV_MAPPED       0x00000008      /* vnode might have user mappings */
 #define        VV_MPSAFE       0x00000010      /* file system code is MP safe */
 #define        VV_LOCKSWORK    0x00000020      /* FS supports locking discipline */
+#define        VV_NONMPSAFE    0x00000040      /* file system code is not MP safe, warned */
 
 /*
  * The second set are locked by vp->v_interlock.  VI_TEXT and VI_EXECMAP are



Home | Main Index | Thread Index | Old Index