From: Greg Kroah-Hartman Date: Wed, 28 Jan 2015 01:24:56 +0000 (-0800) Subject: 3.10-stable patches X-Git-Tag: v3.10.67~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18fa854a2b17d207dcaf421d3d1cc56447c8aa29;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: md-raid5-fetch_block-must-fetch-all-the-blocks-handle_stripe_dirtying-wants.patch --- diff --git a/queue-3.10/md-raid5-fetch_block-must-fetch-all-the-blocks-handle_stripe_dirtying-wants.patch b/queue-3.10/md-raid5-fetch_block-must-fetch-all-the-blocks-handle_stripe_dirtying-wants.patch new file mode 100644 index 00000000000..6464116d54d --- /dev/null +++ b/queue-3.10/md-raid5-fetch_block-must-fetch-all-the-blocks-handle_stripe_dirtying-wants.patch @@ -0,0 +1,47 @@ +From 108cef3aa41669610e1836fe638812dd067d72de Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Wed, 3 Dec 2014 16:07:58 +1100 +Subject: md/raid5: fetch_block must fetch all the blocks handle_stripe_dirtying wants. + +From: NeilBrown + +commit 108cef3aa41669610e1836fe638812dd067d72de upstream. + +It is critical that fetch_block() and handle_stripe_dirtying() +are consistent in their analysis of what needs to be loaded. +Otherwise raid5 can wait forever for a block that won't be loaded. + +Currently when writing to a RAID5 that is resyncing, to a location +beyond the resync offset, handle_stripe_dirtying chooses a +reconstruct-write cycle, but fetch_block() assumes a +read-modify-write, and a lockup can happen. + +So treat that case just like RAID6, just as we do in +handle_stripe_dirtying. RAID6 always does reconstruct-write. + +This bug was introduced when the behaviour of handle_stripe_dirtying +was changed in 3.7, so the patch is suitable for any kernel since, +though it will need careful merging for some versions. + +Cc: stable@vger.kernel.org (v3.7+) +Fixes: a7854487cd7128a30a7f4f5259de9f67d5efb95f +Reported-by: Henry Cai +Signed-off-by: NeilBrown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/raid5.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -2678,7 +2678,8 @@ static int fetch_block(struct stripe_hea + (s->failed >= 2 && fdev[1]->toread) || + (sh->raid_conf->level <= 5 && s->failed && fdev[0]->towrite && + !test_bit(R5_OVERWRITE, &fdev[0]->flags)) || +- (sh->raid_conf->level == 6 && s->failed && s->to_write))) { ++ ((sh->raid_conf->level == 6 || sh->sector >= sh->raid_conf->mddev->recovery_cp) ++ && s->failed && s->to_write))) { + /* we would like to get this block, possibly by computing it, + * otherwise read it if the backing disk is insync + */ diff --git a/queue-3.10/series b/queue-3.10/series index f93d92e0dd0..4a204aa3afe 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -29,3 +29,4 @@ crypto-include-crypto-module-prefix-in-template.patch crypto-add-missing-crypto-module-aliases.patch quota-provide-interface-for-readding-allocated-space-into-reserved-space.patch ext4-fix-warning-in-ext4_da_update_reserve_space.patch +md-raid5-fetch_block-must-fetch-all-the-blocks-handle_stripe_dirtying-wants.patch