diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2013-07-01 11:33:22 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2013-07-01 11:33:22 +0000 |
commit | 4ba62a83062e6be48f6effc72969fa3061f565d1 (patch) | |
tree | 1de467945b7ef0a9f098f7685e33cc333eda6412 | |
parent | c283c47da39ee162f91ce86b46d36828182d833a (diff) |
When an I/O error occurs on a softraid chunk, only take it offline if the
discipline supports redundancy. In the non-redundant case, there is little
to gain my failing the chunk, in fact it just makes any form of data
recovery significantly harder.
ok krw@ todd@
-rw-r--r-- | sys/dev/softraid.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index a0a190b3c7c..8a7ea44b8e6 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.309 2013/06/11 16:42:13 deraadt Exp $ */ +/* $OpenBSD: softraid.c,v 1.310 2013/07/01 11:33:21 jsing Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -2079,12 +2079,14 @@ sr_ccb_done(struct sr_ccb *ccb) if (ccb->ccb_buf.b_flags & B_ERROR) { DNPRINTF(SR_D_INTR, "%s: i/o error on block %lld target %d\n", DEVNAME(sc), ccb->ccb_buf.b_blkno, ccb->ccb_target); - if (!ISSET(sd->sd_capabilities, SR_CAP_REDUNDANT)) + if (ISSET(sd->sd_capabilities, SR_CAP_REDUNDANT)) + sd->sd_set_chunk_state(sd, ccb->ccb_target, + BIOC_SDOFFLINE); + else printf("%s: i/o error on block %lld target %d " "b_error %d\n", DEVNAME(sc), ccb->ccb_buf.b_blkno, ccb->ccb_target, ccb->ccb_buf.b_error); ccb->ccb_state = SR_CCB_FAILED; - sd->sd_set_chunk_state(sd, ccb->ccb_target, BIOC_SDOFFLINE); wu->swu_ios_failed++; } else { ccb->ccb_state = SR_CCB_OK; |