Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9283d8c5 authored by NeilBrown's avatar NeilBrown
Browse files

md/raid5: never wait for bad-block acks on failed device.



Once a device is failed we really want to completely ignore it.
It should go away soon anyway.

In particular the presence of bad blocks on it should not cause us to
block as we won't be trying to write there anyway.

So as soon as we can check if a device is Faulty, do so and pretend
that it is already gone if it is Faulty.

Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 8bd2f0a0
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -3036,6 +3036,8 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
		if (dev->written)
		if (dev->written)
			s->written++;
			s->written++;
		rdev = rcu_dereference(conf->disks[i].rdev);
		rdev = rcu_dereference(conf->disks[i].rdev);
		if (rdev && test_bit(Faulty, &rdev->flags))
			rdev = NULL;
		if (rdev) {
		if (rdev) {
			is_bad = is_badblock(rdev, sh->sector, STRIPE_SECTORS,
			is_bad = is_badblock(rdev, sh->sector, STRIPE_SECTORS,
					     &first_bad, &bad_sectors);
					     &first_bad, &bad_sectors);
@@ -3063,7 +3065,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
			}
			}
		} else if (test_bit(In_sync, &rdev->flags))
		} else if (test_bit(In_sync, &rdev->flags))
			set_bit(R5_Insync, &dev->flags);
			set_bit(R5_Insync, &dev->flags);
		else if (!test_bit(Faulty, &rdev->flags)) {
		else {
			/* in sync if before recovery_offset */
			/* in sync if before recovery_offset */
			if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset)
			if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset)
				set_bit(R5_Insync, &dev->flags);
				set_bit(R5_Insync, &dev->flags);