Module Name: src
Committed By: riz
Date: Wed Nov 2 20:31:18 UTC 2011
Modified Files:
src/sys/arch/xen/xen [netbsd-5-0]: 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 -r1.20.6.1 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 src/sys/arch/xen/xen/xbdback_xenbus.c:1.20.6.1
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.20 Fri Oct 24 18:02:58 2008
+++ src/sys/arch/xen/xen/xbdback_xenbus.c Wed Nov 2 20:31:18 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: xbdback_xenbus.c,v 1.20 2008/10/24 18:02:58 jym Exp $ */
+/* $NetBSD: xbdback_xenbus.c,v 1.20.6.1 2011/11/02 20:31:18 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 2008/10/24 18:02:58 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.20.6.1 2011/11/02 20:31:18 riz Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -624,10 +624,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;