[lkml]   [2009]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[patch 06/85] dm raid1: fix error count
2.6.27-stable review patch.  If anyone has any objections, please let us know.


From: Jonathan Brassow <>

commit d460c65a6a9ec9e0d284864ec3a9a2d1b73f0e43 upstream.

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

Signed-off-by: Milan Broz <>
Signed-off-by: Jonathan Brassow <>
Signed-off-by: Alasdair G Kergon <>
Signed-off-by: Greg Kroah-Hartman <>

drivers/md/dm-raid1.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -727,9 +727,6 @@ static void fail_mirror(struct mirror *m
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
@@ -740,6 +737,9 @@ static void fail_mirror(struct mirror *m
if (test_and_set_bit(error_type, &m->error_type))

+ if (!errors_handled(ms))
+ return;
if (m != get_default_mirror(ms))
goto out;

 \ /
  Last update: 2009-01-15 23:07    [W:0.340 / U:1.120 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site