Module Name:    src
Committed By:   bouyer
Date:           Wed Oct 14 18:54:01 UTC 2009

Modified Files:
        src/sys/arch/xen/xen: xbdback_xenbus.c

Log Message:
Don't pass a NULL arg to DIOCCACHESYNC, sd(4) dereferences it.
Pass a pointer to a int initialized to 1, so that a DIOCCACHESYNC will be
forced on sd(4).
Should fix dom0 panic reported by Sarton O'Brien.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 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.25 src/sys/arch/xen/xen/xbdback_xenbus.c:1.26
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.25	Wed Sep 23 17:48:55 2009
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Wed Oct 14 18:54:00 2009
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbdback_xenbus.c,v 1.25 2009/09/23 17:48:55 bouyer Exp $      */
+/*      $NetBSD: xbdback_xenbus.c,v 1.26 2009/10/14 18:54:00 bouyer Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.25 2009/09/23 17:48:55 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.26 2009/10/14 18:54:00 bouyer Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1316,9 +1316,10 @@
 
 	if (xbd_io->xio_operation == BLKIF_OP_FLUSH_DISKCACHE) {
 		int error;
+		int force = 1;
 		struct xbdback_instance *xbdi = xbd_io->xio_xbdi;
 
-		error = VOP_IOCTL(xbdi->xbdi_vp, DIOCCACHESYNC, NULL, FWRITE,
+		error = VOP_IOCTL(xbdi->xbdi_vp, DIOCCACHESYNC, &force, FWRITE,
 		    kauth_cred_get());
 		if (error) {
 			aprint_error("xbdback %s: DIOCCACHESYNC returned %d\n",

Reply via email to