raid5: delayed stripe fix (Closes: #680366)

svn path=/dists/sid/linux/; revision=19274
This commit is contained in:
Ben Hutchings 2012-07-22 16:28:43 +00:00
parent 45ce64535b
commit 3eb84c68dc
3 changed files with 41 additions and 0 deletions

1
debian/changelog vendored
View File

@ -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.

View File

@ -0,0 +1,39 @@
From: Shaohua Li <shli@kernel.org>
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 <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
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);
}

View File

@ -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