Module Name: src
Committed By: riz
Date: Wed Nov 2 20:31:40 UTC 2011
Modified Files:
src/sys/arch/xen/xen [netbsd-5-1]: 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.3.2.2 -r1.20.4.3.2.3 \
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.3.2.2 src/sys/arch/xen/xen/xbdback_xenbus.c:1.20.4.3.2.3
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.20.4.3.2.2 Sat Jun 18 16:39:10 2011
+++ src/sys/arch/xen/xen/xbdback_xenbus.c Wed Nov 2 20:31:40 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: xbdback_xenbus.c,v 1.20.4.3.2.2 2011/06/18 16:39:10 bouyer Exp $ */
+/* $NetBSD: xbdback_xenbus.c,v 1.20.4.3.2.3 2011/11/02 20:31:40 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.3.2.2 2011/06/18 16:39:10 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.20.4.3.2.3 2011/11/02 20:31:40 riz Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -673,10 +673,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;