NetBSD-Bugs archive

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

Re: port-xen/45158: Xen Kernel panics when restarting DomU (Problem with vnd detach?)



On Tue, Jul 26, 2011 at 12:43:40PM +0200, Roger Pau Monné wrote:
> I've sent this patch to tech-kern, but I'm afraid the problem is far
> deeper, this only prevents xbdback from trying to attach an already
> attached disk, and the crash doesn't happen, but the problem is still
> there in the underlying functions called by xbdback (bdevvp, vn_lock
> or VOP_OPEN). I'm still trying to figure out which one of this
> functions is responsible of the problem. I think the patch should be
> added anyway, because it prevents from doing unnecessary syscalls, an
> avoids the typical "xbdback backend/vbd/2/51714: can't VOP_OPEN device
> 0xa906: 16", but it's not a complete solution for this bug.

It looks like there is spurious calls to xbdback_backend_changed(), and
this functions doesn't handle properly this case. What about the (untested)
attached patch instead ?

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--
Index: xen/xbdback_xenbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/xen/xen/xbdback_xenbus.c,v
retrieving revision 1.41
diff -u -p -r1.41 xbdback_xenbus.c
--- xen/xbdback_xenbus.c        24 Jul 2011 23:56:34 -0000      1.41
+++ xen/xbdback_xenbus.c        27 Jul 2011 16:13:00 -0000
@@ -690,10 +690,16 @@ xbdback_backend_changed(struct xenbus_wa
         */
        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