[PATCH 2/2] dm-raid1: [PATCH RFC] dm-raid1: keep writing after leg failure -> fix error end io logic if 'keep_log' set for on log failure; add ctr/... comments

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

 



From: Heinz Mauelshagen <heinzm@xxxxxxxxxx>


The error endio log path seems wrong, because
the patch fails the io in case "keep_log" is set and
the log is _not_ errored.

It should be failed (as the comment explains), when
"keep_log" is set and the log has failed.


Signed-off-by: Heinz Mauelshagen <heinzm@xxxxxxxxxx>

---
 drivers/md/dm-raid1.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index ef5f20c..cbf3527 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -813,9 +813,11 @@ static void do_failures(struct mirror_set *ms, struct bio_list *failures)
 		 */
 
 		/*
-		 * we return EIO when the log device is failed if keep_log is set
+		 * We return EIO when there's no valid mirror legs
+		 * -or-
+		 * the log device is failed if keep_log is set
 		 */
-		if (!get_valid_mirror(ms) || (keep_log(ms) && !ms->log_failure))
+		if (unlikely(!get_valid_mirror(ms) || (keep_log(ms) && ms->log_failure)))
 			bio_endio(bio, -EIO);
 		/*
 		 * After the userspace get noticed that the leg has failed,
@@ -1048,7 +1050,7 @@ static int parse_features(struct mirror_set *ms, unsigned argc, char **argv,
  * log_type is "core" or "disk"
  * #log_params is between 1 and 3
  *
- * If present, features must be "handle_errors".
+ * If present, features must be "handle_errors" and/or "keep_log".
  */
 static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 {
@@ -1417,7 +1419,6 @@ static void mirror_status(struct dm_target *ti, status_type_t type,
 			DMEMIT(" 2 handle_errors keep_log");
 		else if (errors_handled(ms))
 			DMEMIT(" 1 handle_errors");
-
 	}
 }
 
-- 
2.1.0

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux