aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-07-10 07:54:57 -0400
committerNeil Brown <neilb@suse.de>2008-07-10 01:25:18 -0400
commit7a1fc53c5adb910751a9b212af90302eb4ffb527 (patch)
tree9006ecc4323f2a55e6e16f2e19e41ec3c4c3a1ea /drivers/md/raid5.c
parent9bbbca3a0ee09293108b67835c6bdf6196d7bcb3 (diff)
md: ensure all blocks are uptodate or locked when syncing
Remove the dubious attempt to prefer 'compute' over 'read'. Not only is it wrong given commit c337869d (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>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 54c8ee28fcc4..3b27df52456b 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2017,12 +2017,7 @@ static int __handle_issuing_new_read_requests5(struct stripe_head *sh,
2017 */ 2017 */
2018 s->uptodate++; 2018 s->uptodate++;
2019 return 0; /* uptodate + compute == disks */ 2019 return 0; /* uptodate + compute == disks */
2020 } else if ((s->uptodate < disks - 1) && 2020 } else if (test_bit(R5_Insync, &dev->flags)) {
2021 test_bit(R5_Insync, &dev->flags)) {
2022 /* Note: we hold off compute operations while checks are
2023 * in flight, but we still prefer 'compute' over 'read'
2024 * hence we only read if (uptodate < * disks-1)
2025 */
2026 set_bit(R5_LOCKED, &dev->flags); 2021 set_bit(R5_LOCKED, &dev->flags);
2027 set_bit(R5_Wantread, &dev->flags); 2022 set_bit(R5_Wantread, &dev->flags);
2028 if (!test_and_set_bit(STRIPE_OP_IO, &sh->ops.pending)) 2023 if (!test_and_set_bit(STRIPE_OP_IO, &sh->ops.pending))