Commit ce503f59 authored by Jonathan Brassow's avatar Jonathan Brassow Committed by Linus Torvalds

[PATCH] dm kcopyd: error accumulation fix

kcopyd should accumulate errors - otherwise I/O failures may be ignored
unintentionally.

And invert 'success' (used in a future patch), using a more intuitive
!(read_err || write_err).
Signed-off-by: default avatarJonathan Brassow <jbrassow@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8a835f11
...@@ -602,7 +602,7 @@ static void recovery_complete(int read_err, unsigned int write_err, ...@@ -602,7 +602,7 @@ static void recovery_complete(int read_err, unsigned int write_err,
struct region *reg = (struct region *) context; struct region *reg = (struct region *) context;
/* FIXME: better error handling */ /* FIXME: better error handling */
rh_recovery_end(reg, read_err || write_err); rh_recovery_end(reg, !(read_err || write_err));
} }
static int recover(struct mirror_set *ms, struct region *reg) static int recover(struct mirror_set *ms, struct region *reg)
......
...@@ -314,7 +314,7 @@ static void complete_io(unsigned long error, void *context) ...@@ -314,7 +314,7 @@ static void complete_io(unsigned long error, void *context)
if (error) { if (error) {
if (job->rw == WRITE) if (job->rw == WRITE)
job->write_err &= error; job->write_err |= error;
else else
job->read_err = 1; job->read_err = 1;
...@@ -460,7 +460,7 @@ static void segment_complete(int read_err, ...@@ -460,7 +460,7 @@ static void segment_complete(int read_err,
job->read_err = 1; job->read_err = 1;
if (write_err) if (write_err)
job->write_err &= write_err; job->write_err |= write_err;
/* /*
* Only dispatch more work if there hasn't been an error. * Only dispatch more work if there hasn't been an error.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment