Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/jdolecek-ncq]: src/sys/dev/ata KASSERT() that chaosed xfer actually ends...
details: https://anonhg.NetBSD.org/src/rev/cce190d26c4b
branches: jdolecek-ncq
changeset: 352715:cce190d26c4b
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Fri Jul 21 17:32:27 2017 +0000
description:
KASSERT() that chaosed xfer actually ends up with error; might end up being
returned as successful due to bugs in error recovery code
diffstat:
sys/dev/ata/atavar.h | 3 ++-
sys/dev/ata/wd.c | 8 ++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diffs (53 lines):
diff -r 831fe7628d59 -r cce190d26c4b sys/dev/ata/atavar.h
--- a/sys/dev/ata/atavar.h Wed Jul 19 20:26:52 2017 +0000
+++ b/sys/dev/ata/atavar.h Fri Jul 21 17:32:27 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atavar.h,v 1.92.8.17 2017/07/19 19:39:28 jdolecek Exp $ */
+/* $NetBSD: atavar.h,v 1.92.8.18 2017/07/21 17:32:27 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -186,6 +186,7 @@
#define C_NCQ 0x0100 /* command is queued */
#define C_IMMEDIATE 0x0200 /* execute command without queuing */
#define C_WAITTIMO 0x0400 /* race vs. timeout */
+#define C_CHAOS 0x0800 /* forced error xfer */
/* reasons for c_kill_xfer() */
#define KILL_GONE 1 /* device is gone while xfer was active */
diff -r 831fe7628d59 -r cce190d26c4b sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c Wed Jul 19 20:26:52 2017 +0000
+++ b/sys/dev/ata/wd.c Fri Jul 21 17:32:27 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wd.c,v 1.428.2.27 2017/07/19 19:46:52 jdolecek Exp $ */
+/* $NetBSD: wd.c,v 1.428.2.28 2017/07/21 17:32:27 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.27 2017/07/19 19:46:52 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.28 2017/07/21 17:32:27 jdolecek Exp $");
#include "opt_ata.h"
#include "opt_wd.h"
@@ -713,6 +713,7 @@
aprint_normal_dev(wd->sc_dev, "%s: chaos xfer %d\n",
__func__, xfer->c_slot);
xfer->c_bio.blkno = 7777777 + wd->sc_capacity;
+ xfer->c_flags |= C_CHAOS;
}
#endif
@@ -893,6 +894,9 @@
noerror: if ((xfer->c_bio.flags & ATA_CORR) || xfer->c_retries > 0)
aprint_error_dev(wd->sc_dev,
"soft error (corrected)\n");
+#ifdef WD_CHAOS_MONKEY
+ KASSERT((xfer->c_flags & C_CHAOS) == 0);
+#endif
break;
case ERR_NODEV:
bp->b_error = EIO;
Home |
Main Index |
Thread Index |
Old Index