From f2016281ec1ed8fd3deddef53e1fa6cb07a13cb6 Mon Sep 17 00:00:00 2001 From: jsing Date: Mon, 1 Jul 2013 11:33:21 +0000 Subject: 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@ --- sys/dev/softraid.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/dev/softraid.c') 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 * Copyright (c) 2008 Chris Kuethe @@ -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; -- cgit v1.2.3-59-g8ed1b