Module Name: src Committed By: riz Date: Wed Nov 2 20:30:41 UTC 2011
Modified Files: src/sys/arch/xen/xen [netbsd-5]: xbdback_xenbus.c Log Message: Pull up following revision(s) (requested by bouyer in ticket #1682): sys/arch/xen/xen/xbdback_xenbus.c: revision 1.45 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. To generate a diff of this commit: cvs rdiff -u -r1.20.4.6 -r1.20.4.7 src/sys/arch/xen/xen/xbdback_xenbus.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/arch/xen/xen/xbdback_xenbus.c diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.20.4.6 src/sys/arch/xen/xen/xbdback_xenbus.c:1.20.4.7 --- src/sys/arch/xen/xen/xbdback_xenbus.c:1.20.4.6 Fri Aug 12 20:48:47 2011 +++ src/sys/arch/xen/xen/xbdback_xenbus.c Wed Nov 2 20:30:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: xbdback_xenbus.c,v 1.20.4.6 2011/08/12 20:48:47 riz Exp $ */ +/* $NetBSD: xbdback_xenbus.c,v 1.20.4.7 2011/11/02 20:30:41 riz Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.20.4.6 2011/08/12 20:48:47 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.20.4.7 2011/11/02 20:30:41 riz Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -674,10 +674,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%x to " - "0x%lx not supported\n", xbusd->xbusd_path, xbdi->xbdi_dev, - dev); + /* + * we can also fire up after having opened 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%x to 0x%lx not supported\n", + xbusd->xbusd_path, xbdi->xbdi_dev, dev); + } return; } xbdi->xbdi_dev = dev;