Skip to content

Commit

Permalink
md: ensure all blocks are uptodate or locked when syncing
Browse files Browse the repository at this point in the history
Remove the dubious attempt to prefer 'compute' over 'read'.  Not only is it
wrong given commit c337869 (md: do not compute parity unless it is on a failed
drive), but it can trigger a BUG_ON in handle_parity_checks5().

Cc: <stable@kernel.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Neil Brown <neilb@suse.de>
  • Loading branch information
Dan Williams authored and Neil Brown committed Jul 10, 2008
1 parent 9bbbca3 commit 7a1fc53
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -2017,12 +2017,7 @@ static int __handle_issuing_new_read_requests5(struct stripe_head *sh,
*/
s->uptodate++;
return 0; /* uptodate + compute == disks */
} else if ((s->uptodate < disks - 1) &&
test_bit(R5_Insync, &dev->flags)) {
/* Note: we hold off compute operations while checks are
* in flight, but we still prefer 'compute' over 'read'
* hence we only read if (uptodate < * disks-1)
*/
} else if (test_bit(R5_Insync, &dev->flags)) {
set_bit(R5_LOCKED, &dev->flags);
set_bit(R5_Wantread, &dev->flags);
if (!test_and_set_bit(STRIPE_OP_IO, &sh->ops.pending))
Expand Down

0 comments on commit 7a1fc53

Please sign in to comment.