Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/xen Don't pass a NULL arg to DIOCCACHESYNC, sd(...



details:   https://anonhg.NetBSD.org/src/rev/cf64a11d10fc
branches:  trunk
changeset: 748135:cf64a11d10fc
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Oct 14 18:54:00 2009 +0000

description:
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.

diffstat:

 sys/arch/xen/xen/xbdback_xenbus.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r b72b28e8c9f2 -r cf64a11d10fc sys/arch/xen/xen/xbdback_xenbus.c
--- a/sys/arch/xen/xen/xbdback_xenbus.c Wed Oct 14 18:34:14 2009 +0000
+++ b/sys/arch/xen/xen/xbdback_xenbus.c Wed Oct 14 18:54:00 2009 +0000
@@ -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",



Home | Main Index | Thread Index | Old Index