Module Name:    src
Committed By:   martin
Date:           Mon Dec 10 17:16:11 UTC 2018

Modified Files:
        src/sys/dev [netbsd-8]: vnd.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1133):

        sys/dev/vnd.c: revision 1.270

Operation handle_with_strategy() also needs the
fstrans_start_lazy() / fstrans_done() bracket.

PR kern/53624 (dom0 freeze on domU exit)


To generate a diff of this commit:
cvs rdiff -u -r1.259.6.4 -r1.259.6.5 src/sys/dev/vnd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.259.6.4 src/sys/dev/vnd.c:1.259.6.5
--- src/sys/dev/vnd.c:1.259.6.4	Sat Oct 13 17:21:51 2018
+++ src/sys/dev/vnd.c	Mon Dec 10 17:16:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.259.6.4 2018/10/13 17:21:51 martin Exp $	*/
+/*	$NetBSD: vnd.c,v 1.259.6.5 2018/12/10 17:16:11 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.259.6.4 2018/10/13 17:21:51 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.259.6.5 2018/12/10 17:16:11 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -733,12 +733,17 @@ vndthread(void *arg)
 		bp->b_bcount = obp->b_bcount;
 		BIO_COPYPRIO(bp, obp);
 
+		/* Make sure the request succeeds while suspending this fs. */
+		fstrans_start_lazy(vnd->sc_vp->v_mount);
+
 		/* Handle the request using the appropriate operations. */
 		if ((vnd->sc_flags & VNF_USE_VN_RDWR) == 0)
 			handle_with_strategy(vnd, obp, bp);
 		else
 			handle_with_rdwr(vnd, obp, bp);
 
+		fstrans_done(vnd->sc_vp->v_mount);
+
 		s = splbio();
 		continue;
 
@@ -804,9 +809,6 @@ handle_with_rdwr(struct vnd_softc *vnd, 
 		    bp->b_bcount);
 #endif
 
-	/* Make sure the request succeeds while suspending this fs. */
-	fstrans_start_lazy(vp->v_mount);
-
 	/* Issue the read or write operation. */
 	bp->b_error =
 	    vn_rdwr(doread ? UIO_READ : UIO_WRITE,
@@ -818,8 +820,6 @@ handle_with_rdwr(struct vnd_softc *vnd, 
 	(void) VOP_PUTPAGES(vp, 0, 0,
 	    PGO_ALLPAGES | PGO_CLEANIT | PGO_FREE | PGO_SYNCIO);
 
-	fstrans_done(vp->v_mount);
-
 	/* We need to increase the number of outputs on the vnode if
 	 * there was any write to it. */
 	if (!doread) {

Reply via email to