Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108524
b: refs/heads/master
c: ac4090d
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown committed Aug 5, 2008
1 parent 8e30ce3 commit 5433965
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dba034eef2456d2a9f9a76806846c97acf6c3ad1
refs/heads/master: ac4090d24c6a26211bc4523d920376e054d4f3f8
29 changes: 21 additions & 8 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -2568,10 +2568,10 @@ static bool handle_stripe5(struct stripe_head *sh)
if (dev->written)
s.written++;
rdev = rcu_dereference(conf->disks[i].rdev);
if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) {
if (blocked_rdev == NULL &&
rdev && unlikely(test_bit(Blocked, &rdev->flags))) {
blocked_rdev = rdev;
atomic_inc(&rdev->nr_pending);
break;
}
if (!rdev || !test_bit(In_sync, &rdev->flags)) {
/* The ReadError flag will just be confusing now */
Expand All @@ -2588,8 +2588,14 @@ static bool handle_stripe5(struct stripe_head *sh)
rcu_read_unlock();

if (unlikely(blocked_rdev)) {
set_bit(STRIPE_HANDLE, &sh->state);
goto unlock;
if (s.syncing || s.expanding || s.expanded ||
s.to_write || s.written) {
set_bit(STRIPE_HANDLE, &sh->state);
goto unlock;
}
/* There is nothing for the blocked_rdev to block */
rdev_dec_pending(blocked_rdev, conf->mddev);
blocked_rdev = NULL;
}

if (s.to_fill && !test_bit(STRIPE_BIOFILL_RUN, &sh->state)) {
Expand Down Expand Up @@ -2832,10 +2838,10 @@ static bool handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
if (dev->written)
s.written++;
rdev = rcu_dereference(conf->disks[i].rdev);
if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) {
if (blocked_rdev == NULL &&
rdev && unlikely(test_bit(Blocked, &rdev->flags))) {
blocked_rdev = rdev;
atomic_inc(&rdev->nr_pending);
break;
}
if (!rdev || !test_bit(In_sync, &rdev->flags)) {
/* The ReadError flag will just be confusing now */
Expand All @@ -2853,9 +2859,16 @@ static bool handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
rcu_read_unlock();

if (unlikely(blocked_rdev)) {
set_bit(STRIPE_HANDLE, &sh->state);
goto unlock;
if (s.syncing || s.expanding || s.expanded ||
s.to_write || s.written) {
set_bit(STRIPE_HANDLE, &sh->state);
goto unlock;
}
/* There is nothing for the blocked_rdev to block */
rdev_dec_pending(blocked_rdev, conf->mddev);
blocked_rdev = NULL;
}

pr_debug("locked=%d uptodate=%d to_read=%d"
" to_write=%d failed=%d failed_num=%d,%d\n",
s.locked, s.uptodate, s.to_read, s.to_write, s.failed,
Expand Down

0 comments on commit 5433965

Please sign in to comment.