Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: 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>

authored by

Jonathan Brassow and committed by
Linus Torvalds
ce503f59 8a835f11

+3 -3
+1 -1
drivers/md/dm-raid1.c
··· 602 602 struct region *reg = (struct region *) context; 603 603 604 604 /* FIXME: better error handling */ 605 - rh_recovery_end(reg, read_err || write_err); 605 + rh_recovery_end(reg, !(read_err || write_err)); 606 606 } 607 607 608 608 static int recover(struct mirror_set *ms, struct region *reg)
+2 -2
drivers/md/kcopyd.c
··· 314 314 315 315 if (error) { 316 316 if (job->rw == WRITE) 317 - job->write_err &= error; 317 + job->write_err |= error; 318 318 else 319 319 job->read_err = 1; 320 320 ··· 460 460 job->read_err = 1; 461 461 462 462 if (write_err) 463 - job->write_err &= write_err; 463 + job->write_err |= write_err; 464 464 465 465 /* 466 466 * Only dispatch more work if there hasn't been an error.