]> err.no Git - linux-2.6/commitdiff
[PATCH] dm kcopyd: error accumulation fix
authorJonathan Brassow <jbrassow@redhat.com>
Mon, 26 Jun 2006 07:27:30 +0000 (00:27 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 26 Jun 2006 16:58:35 +0000 (09:58 -0700)
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>
drivers/md/dm-raid1.c
drivers/md/kcopyd.c

index 84f2ed6d9c5b077b909d77e289097646c5554185..6ae42f1d76ae33f432554bad6682f2e10c4bc02e 100644 (file)
@@ -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)
index 72480a48d88b7c883635ce46a41a00079ee6e1a3..73ab875fb1580789a0e260557caad2cea40e44de 100644 (file)
@@ -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;
 
@@ -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.