Skip to content

Commit

Permalink
[PATCH] dm kcopyd: error accumulation fix
Browse files Browse the repository at this point in the history
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: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
jbrassow authored and Linus Torvalds committed Jun 26, 2006
1 parent 8a835f1 commit ce503f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ static void recovery_complete(int read_err, unsigned int write_err,
struct region *reg = (struct region *) context;

/* 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)
Expand Down
4 changes: 2 additions & 2 deletions drivers/md/kcopyd.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static void complete_io(unsigned long error, void *context)

if (error) {
if (job->rw == WRITE)
job->write_err &= error;
job->write_err |= error;
else
job->read_err = 1;

Expand Down Expand Up @@ -460,7 +460,7 @@ static void segment_complete(int read_err,
job->read_err = 1;

if (write_err)
job->write_err &= write_err;
job->write_err |= write_err;

/*
* Only dispatch more work if there hasn't been an error.
Expand Down

0 comments on commit ce503f5

Please sign in to comment.