summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2015-08-14 11:26:17 +1000
committerNeilBrown <neilb@suse.com>2015-08-31 19:43:45 +0200
commit95af587e95aacb9cfda4a9641069a5244a540dc8 (patch)
tree7f891cb4a1cd2b31e3543f05c95fab9baba0aef9 /drivers/md/raid10.h
parent55ce74d4bfe1b9444436264c637f39a152d1e5ac (diff)
downloadlinux-95af587e95aacb9cfda4a9641069a5244a540dc8.tar.gz
linux-95af587e95aacb9cfda4a9641069a5244a540dc8.tar.bz2
linux-95af587e95aacb9cfda4a9641069a5244a540dc8.zip
md/raid10: ensure device failure recorded before write request returns.
When a write to one of the legs of a RAID10 fails, the failure is recorded in the metadata of the other legs so that after a restart the data on the failed drive wont be trusted even if that drive seems to be working again (maybe a cable was unplugged). Currently there is no interlock between the write request completing and the metadata update. So it is possible that the write will complete, the app will confirm success in some way, and then the machine will crash before the metadata update completes. This is an extremely small hole for a racy to fit in, but it is theoretically possible and so should be closed. So: - set MD_CHANGE_PENDING when requesting a metadata update for a failed device, so we can know with certainty when it completes - queue requests that experienced an error on a new queue which is only processed after the metadata update completes - call raid_end_bio_io() on bios in that queue when the time comes. Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/raid10.h')
-rw-r--r--drivers/md/raid10.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h
index 5ee6473ddc2c..6fc2c75759bf 100644
--- a/drivers/md/raid10.h
+++ b/drivers/md/raid10.h
@@ -53,6 +53,12 @@ struct r10conf {
sector_t offset_diff;
struct list_head retry_list;
+ /* A separate list of r1bio which just need raid_end_bio_io called.
+ * This mustn't happen for writes which had any errors if the superblock
+ * needs to be written.
+ */
+ struct list_head bio_end_io_list;
+
/* queue pending writes and submit them on unplug */
struct bio_list pending_bio_list;
int pending_count;