[PATCH 09/15] dm kcopyd: error accumulation fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jonathan Brassow <[email protected]>

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 <[email protected]>
Signed-off-by: Alasdair G Kergon <[email protected]>

Index: linux-2.6.17/drivers/md/kcopyd.c
===================================================================
--- linux-2.6.17.orig/drivers/md/kcopyd.c	2006-06-21 16:19:34.000000000 +0100
+++ linux-2.6.17/drivers/md/kcopyd.c	2006-06-21 17:17:57.000000000 +0100
@@ -314,7 +314,7 @@ static void complete_io(unsigned long er
 
 	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_er
 		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.
Index: linux-2.6.17/drivers/md/dm-raid1.c
===================================================================
--- linux-2.6.17.orig/drivers/md/dm-raid1.c	2006-06-21 17:17:49.000000000 +0100
+++ linux-2.6.17/drivers/md/dm-raid1.c	2006-06-21 17:17:57.000000000 +0100
@@ -604,7 +604,7 @@ static void recovery_complete(int read_e
 	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)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux