Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/kern Pull up following revision(s) (requested by hann...



details:   https://anonhg.NetBSD.org/src/rev/1cf9400f6c8e
branches:  netbsd-9
changeset: 1000975:1cf9400f6c8e
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Oct 15 18:12:25 2019 +0000

description:
Pull up following revision(s) (requested by hannken in ticket #307):

        sys/kern/vnode_if.sh: revision 1.67
        sys/kern/vnode_if.src: revision 1.78

As VOP_STRATEGY() usually calls itself on the file system holding "/dev"
it may deadlock on suspension of this file system.

Add fstrans type LAZY and use it for VOP_STRATEGY().

Adress PR kern/53624 (dom0 freeze on domU exit) is still there

diffstat:

 sys/kern/vnode_if.sh  |  10 ++++++----
 sys/kern/vnode_if.src |   3 ++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diffs (65 lines):

diff -r 41bfe115744b -r 1cf9400f6c8e sys/kern/vnode_if.sh
--- a/sys/kern/vnode_if.sh      Tue Oct 15 18:10:09 2019 +0000
+++ b/sys/kern/vnode_if.sh      Tue Oct 15 18:12:25 2019 +0000
@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  */
 "
-SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.66 2017/06/04 08:03:26 hannken Exp $'
+SCRIPT_ID='$NetBSD: vnode_if.sh,v 1.66.10.1 2019/10/15 18:12:25 martin Exp $'
 
 # Script to produce VFS front-end sugar.
 #
@@ -318,7 +318,7 @@
 
 if [ -z "${rump}" ] ; then
        echo "
-enum fst_op { FST_NO, FST_YES, FST_TRY };
+enum fst_op { FST_NO, FST_YES, FST_LAZY, FST_TRY };
 
 static inline int
 vop_pre(vnode_t *vp, struct mount **mp, bool *mpsafe, enum fst_op op)
@@ -331,7 +331,7 @@
                KERNEL_LOCK(1, curlwp);
        }
 
-       if (op == FST_YES || op == FST_TRY) {
+       if (op == FST_YES || op == FST_LAZY || op == FST_TRY) {
                for (;;) {
                        *mp = vp->v_mount;
                        if (op == FST_TRY) {
@@ -342,6 +342,8 @@
                                        }
                                        return error;
                                }
+                       } else if (op == FST_LAZY) {
+                               fstrans_start_lazy(*mp);
                        } else {
                                fstrans_start(*mp);
                        }
@@ -360,7 +362,7 @@
 vop_post(vnode_t *vp, struct mount *mp, bool mpsafe, enum fst_op op)
 {
 
-       if (op == FST_YES) {
+       if (op == FST_YES || op == FST_LAZY) {
                fstrans_done(mp);
        }
 
diff -r 41bfe115744b -r 1cf9400f6c8e sys/kern/vnode_if.src
--- a/sys/kern/vnode_if.src     Tue Oct 15 18:10:09 2019 +0000
+++ b/sys/kern/vnode_if.src     Tue Oct 15 18:12:25 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: vnode_if.src,v 1.77 2017/07/12 09:31:07 hannken Exp $
+#      $NetBSD: vnode_if.src,v 1.77.10.1 2019/10/15 18:12:25 martin Exp $
 #
 # Copyright (c) 1992, 1993
 #      The Regents of the University of California.  All rights reserved.
@@ -436,6 +436,7 @@
 #% strategy   vp      = = =
 #
 vop_strategy {
+       FSTRANS=LAZY
        IN struct vnode *vp;
        IN struct buf *bp;
 };



Home | Main Index | Thread Index | Old Index