Source-Changes-HG archive

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

[src/trunk]: src/sys/dev do not try to flush device when rebooting with RB_NO...



details:   https://anonhg.NetBSD.org/src/rev/dde4f465afe4
branches:  trunk
changeset: 348248:dde4f465afe4
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Tue Oct 11 18:31:11 2016 +0000

description:
do not try to flush device when rebooting with RB_NOSYNC, so that machine
would still reboot if the device is wedged

diffstat:

 sys/dev/ld.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 57598ab379a7 -r dde4f465afe4 sys/dev/ld.c
--- a/sys/dev/ld.c      Tue Oct 11 17:10:22 2016 +0000
+++ b/sys/dev/ld.c      Tue Oct 11 18:31:11 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ld.c,v 1.97 2016/09/27 03:33:32 pgoyette Exp $ */
+/*     $NetBSD: ld.c,v 1.98 2016/10/11 18:31:11 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.97 2016/09/27 03:33:32 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.98 2016/10/11 18:31:11 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -55,6 +55,7 @@
 #include <sys/syslog.h>
 #include <sys/mutex.h>
 #include <sys/module.h>
+#include <sys/reboot.h>
 
 #include <dev/ldvar.h>
 
@@ -274,7 +275,8 @@
        struct ld_softc *sc = device_private(dev);
        struct dk_softc *dksc = &sc->sc_dksc;
 
-       if (sc->sc_flush != NULL && (*sc->sc_flush)(sc, LDFL_POLL) != 0) {
+       if ((flags & RB_NOSYNC) == 0 && sc->sc_flush != NULL
+           && (*sc->sc_flush)(sc, LDFL_POLL) != 0) {
                device_printf(dksc->sc_dev, "unable to flush cache\n");
                return false;
        }



Home | Main Index | Thread Index | Old Index