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?)



The following reply was made to PR port-xen/45158; it has been noted by GNATS.

From: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau%entel.upc.edu@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: port-xen/45158: Xen Kernel panics when restarting DomU (Problem
 with vnd detach?)
Date: Tue, 26 Jul 2011 13:01:07 +0200

 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.
 
 Regards, Roger.
 
 Index: sys/arch/xen/xen/xbdback_xenbus.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/src/sys/arch/xen/xen/xbdback_xenbus.c,v
 retrieving revision 1.41
 diff -u -r1.41 xbdback_xenbus.c
 --- sys/arch/xen/xen/xbdback_xenbus.c =C2=A0 24 Jul 2011 23:56:34 -0000 =C2=
 =A0 =C2=A0 =C2=A01.41
 +++ sys/arch/xen/xen/xbdback_xenbus.c =C2=A0 25 Jul 2011 15:55:28 -0000
 @@ -675,6 +675,7 @@
 =C2=A0{
 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct xenbus_device *xbusd =3D watch->xbw_dev;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct xbdback_instance *xbdi =3D xbusd->xbusd_u=
 .b.b_cookie;
 + =C2=A0 =C2=A0 =C2=A0 struct xbdback_instance *xbdi_iter;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0int err;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0long dev;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0char *mode;
 @@ -696,6 +697,12 @@
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0xbusd-=
 >xbusd_path, xbdi->xbdi_dev, dev);
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
 + =C2=A0 =C2=A0 =C2=A0 SLIST_FOREACH(xbdi_iter, &xbdback_instances, next) {
 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (xbdi_iter->xbdi_dev =
 =3D=3D dev) {
 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
 =A0 printf("xbdback: device 0x%lx already opened\n", dev);
 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
 =A0 return;
 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
 + =C2=A0 =C2=A0 =C2=A0 }
 =C2=A0 =C2=A0 =C2=A0 =C2=A0xbdi->xbdi_dev =3D dev;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0err =3D xenbus_read(NULL, xbusd->xbusd_path, "mo=
 de", NULL, &mode);
 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (err) {
 


Home | Main Index | Thread Index | Old Index