diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2009-01-05 22:04:57 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-01-05 22:04:57 -0500 |
commit | d460c65a6a9ec9e0d284864ec3a9a2d1b73f0e43 (patch) | |
tree | 84131d888f5ec610cc343ca7188a5d4044043c2b /drivers/md/dm-raid1.c | |
parent | c7a2bd19b7c1e0bd2c7604c53d2583e91e536948 (diff) |
dm raid1: fix error count
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>
Diffstat (limited to 'drivers/md/dm-raid1.c')
-rw-r--r-- | drivers/md/dm-raid1.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index ec43f9fa4b2a..d0fed2b21b08 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c | |||
@@ -197,9 +197,6 @@ static void fail_mirror(struct mirror *m, enum dm_raid1_error error_type) | |||
197 | struct mirror_set *ms = m->ms; | 197 | struct mirror_set *ms = m->ms; |
198 | struct mirror *new; | 198 | struct mirror *new; |
199 | 199 | ||
200 | if (!errors_handled(ms)) | ||
201 | return; | ||
202 | |||
203 | /* | 200 | /* |
204 | * error_count is used for nothing more than a | 201 | * error_count is used for nothing more than a |
205 | * simple way to tell if a device has encountered | 202 | * simple way to tell if a device has encountered |
@@ -210,6 +207,9 @@ static void fail_mirror(struct mirror *m, enum dm_raid1_error error_type) | |||
210 | if (test_and_set_bit(error_type, &m->error_type)) | 207 | if (test_and_set_bit(error_type, &m->error_type)) |
211 | return; | 208 | return; |
212 | 209 | ||
210 | if (!errors_handled(ms)) | ||
211 | return; | ||
212 | |||
213 | if (m != get_default_mirror(ms)) | 213 | if (m != get_default_mirror(ms)) |
214 | goto out; | 214 | goto out; |
215 | 215 | ||