Skip to content

Commit

Permalink
dm raid1: fix error count
Browse files Browse the repository at this point in the history
Always increase the error count when I/O on a leg of a mirror fails.

The error count is used to decide whether to select an alternative
mirror leg.  If the target doesn't use the "handle_errors" feature, the
error count is not updated and the bio can get requeued forever by the
read callback.

Fix it by increasing error_count before the handle_errors feature
checking.

Cc: stable@kernel.org
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Jonathan Brassow authored and Alasdair G Kergon committed Jan 6, 2009
1 parent c7a2bd1 commit d460c65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,6 @@ static void fail_mirror(struct mirror *m, enum dm_raid1_error error_type)
struct mirror_set *ms = m->ms;
struct mirror *new;

if (!errors_handled(ms))
return;

/*
* error_count is used for nothing more than a
* simple way to tell if a device has encountered
Expand All @@ -210,6 +207,9 @@ static void fail_mirror(struct mirror *m, enum dm_raid1_error error_type)
if (test_and_set_bit(error_type, &m->error_type))
return;

if (!errors_handled(ms))
return;

if (m != get_default_mirror(ms))
goto out;

Expand Down

0 comments on commit d460c65

Please sign in to comment.