Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src-all/rev/ff12d31af9fe
branches:  trunk
changeset: 932663:ff12d31af9fe
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 945c791c612d -r ff12d31af9fe 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 945c791c612d -r ff12d31af9fe 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