Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/xen Guard against spurious xbdback_backend_chan...



details:   https://anonhg.NetBSD.org/src/rev/d434ffaab10b
branches:  trunk
changeset: 768078:d434ffaab10b
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Aug 07 17:39:34 2011 +0000

description:
Guard against spurious xbdback_backend_changed() calls which would result
in the block device being opened twice. Fixes port-xen/45158,
although the underlying cause (multiple open of the same device not
properly handled any more) is not fixed.

diffstat:

 sys/arch/xen/xen/xbdback_xenbus.c |  18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diffs (39 lines):

diff -r 04f18f7f8486 -r d434ffaab10b sys/arch/xen/xen/xbdback_xenbus.c
--- a/sys/arch/xen/xen/xbdback_xenbus.c Sun Aug 07 17:15:40 2011 +0000
+++ b/sys/arch/xen/xen/xbdback_xenbus.c Sun Aug 07 17:39:34 2011 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbdback_xenbus.c,v 1.44 2011/08/07 17:15:40 bouyer Exp $      */
+/*      $NetBSD: xbdback_xenbus.c,v 1.45 2011/08/07 17:39:34 bouyer Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.44 2011/08/07 17:15:40 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.45 2011/08/07 17:39:34 bouyer Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -691,10 +691,16 @@
         */
        if (err)
                return;
-       if (xbdi->xbdi_status == CONNECTED && xbdi->xbdi_dev != dev) {
-               printf("xbdback %s: changing physical device from 0x%"PRIx64
-                   " to 0x%lx not supported\n",
-                   xbusd->xbusd_path, xbdi->xbdi_dev, dev);
+       /*
+        * we can also fire up after having openned the device, don't try
+        * to do it twice.
+        */
+       if (xbdi->xbdi_vp != NULL) {
+               if (xbdi->xbdi_status == CONNECTED && xbdi->xbdi_dev != dev) {
+                       printf("xbdback %s: changing physical device from "
+                           "0x%" PRIx64 " to 0x%lx not supported\n",
+                           xbusd->xbusd_path, xbdi->xbdi_dev, dev);
+               }
                return;
        }
        xbdi->xbdi_dev = dev;



Home | Main Index | Thread Index | Old Index