From 3eb84c68dc4622c97d0ff46e59fc0b4de88b49b4 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 22 Jul 2012 16:28:43 +0000 Subject: [PATCH] raid5: delayed stripe fix (Closes: #680366) svn path=/dists/sid/linux/; revision=19274 --- debian/changelog | 1 + .../bugfix/all/raid5-delayed-stripe-fix.patch | 39 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 41 insertions(+) create mode 100644 debian/patches/bugfix/all/raid5-delayed-stripe-fix.patch diff --git a/debian/changelog b/debian/changelog index 205148d04..f17c9e511 100644 --- a/debian/changelog +++ b/debian/changelog @@ -43,6 +43,7 @@ linux (3.2.23-1) UNRELEASED; urgency=low * cipso: don't follow a NULL pointer when setsockopt() is called * [x86] hwmon: Enable SENSORS_SCH5636 as module (Closes: #680934) * atl1c: fix issue of transmit queue 0 timed out + * raid5: delayed stripe fix (Closes: #680366) [ Arnaud Patard ] * [mipsel] add r8169 to d-i udeb. diff --git a/debian/patches/bugfix/all/raid5-delayed-stripe-fix.patch b/debian/patches/bugfix/all/raid5-delayed-stripe-fix.patch new file mode 100644 index 000000000..49edc983c --- /dev/null +++ b/debian/patches/bugfix/all/raid5-delayed-stripe-fix.patch @@ -0,0 +1,39 @@ +From: Shaohua Li +Date: Tue, 3 Jul 2012 15:57:19 +1000 +Subject: raid5: delayed stripe fix + +commit fab363b5ff502d1b39ddcfec04271f5858d9f26e upstream. + +There isn't locking setting STRIPE_DELAYED and STRIPE_PREREAD_ACTIVE bits, but +the two bits have relationship. A delayed stripe can be moved to hold list only +when preread active stripe count is below IO_THRESHOLD. If a stripe has both +the bits set, such stripe will be in delayed list and preread count not 0, +which will make such stripe never leave delayed list. + +Signed-off-by: Shaohua Li +Signed-off-by: NeilBrown +Signed-off-by: Ben Hutchings +--- + drivers/md/raid5.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c +index 51169ec..7245a9d 100644 +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -196,12 +196,14 @@ static void __release_stripe(struct r5conf *conf, struct stripe_head *sh) + BUG_ON(!list_empty(&sh->lru)); + BUG_ON(atomic_read(&conf->active_stripes)==0); + if (test_bit(STRIPE_HANDLE, &sh->state)) { +- if (test_bit(STRIPE_DELAYED, &sh->state)) ++ if (test_bit(STRIPE_DELAYED, &sh->state) && ++ !test_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) + list_add_tail(&sh->lru, &conf->delayed_list); + else if (test_bit(STRIPE_BIT_DELAY, &sh->state) && + sh->bm_seq - conf->seq_write > 0) + list_add_tail(&sh->lru, &conf->bitmap_list); + else { ++ clear_bit(STRIPE_DELAYED, &sh->state); + clear_bit(STRIPE_BIT_DELAY, &sh->state); + list_add_tail(&sh->lru, &conf->handle_list); + } diff --git a/debian/patches/series b/debian/patches/series index 6850344f2..93454001d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -383,3 +383,4 @@ bugfix/all/net-e100-ucode-is-optional-in-some-cases.patch bugfix/x86/drm-i915-prefer-wide-slow-to-fast-narrow-in-DP-confi.patch bugfix/all/cipso-don-t-follow-a-NULL-pointer-when-setsockopt-is.patch bugfix/all/atl1c-fix-issue-of-transmit-queue-0-timed-out.patch +bugfix/all/raid5-delayed-stripe-fix.patch