Thu Apr 16 09:51:40 2020 UTC ()
when checking for physio request check for B_PHYS in b_flags rather
than an internal field, so this works when the original buf is
wrapped by another one by e.g. dk(4)

fixes misfired assert when doing newfs on a wedge, reported by Manuel Bouyer


(jdolecek)
diff -r1.114 -r1.115 src/sys/arch/xen/xen/xbd_xenbus.c

cvs diff -r1.114 -r1.115 src/sys/arch/xen/xen/xbd_xenbus.c (expand / switch to context diff)
--- src/sys/arch/xen/xen/xbd_xenbus.c 2020/04/15 10:16:47 1.114
+++ src/sys/arch/xen/xen/xbd_xenbus.c 2020/04/16 09:51:40 1.115
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbd_xenbus.c,v 1.114 2020/04/15 10:16:47 jdolecek Exp $      */
+/*      $NetBSD: xbd_xenbus.c,v 1.115 2020/04/16 09:51:40 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.114 2020/04/15 10:16:47 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.115 2020/04/16 09:51:40 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -1207,8 +1207,11 @@
 static int
 xbd_map_align(struct xbd_xenbus_softc *sc, struct xbd_req *req)
 {
-	/* Only can get here if this is physio() request */
-	KASSERT(req->req_bp->b_saveaddr != NULL);
+	/*
+	 * Only can get here if this is physio() request, block I/O
+	 * uses DEV_BSIZE-aligned buffers.
+	 */
+	KASSERT((req->req_bp->b_flags & B_PHYS) != 0);
 
 	sc->sc_cnt_map_unalign.ev_count++;