@@ -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");
-
}
}