[dm-devel] [PATCH] dm-raid1: change default mirror when it's not in sync

Lidong Zhong lzhong at suse.com
Wed Apr 15 10:50:40 UTC 2015


Change the default mirror to a valid leg even when it's not in sync,
otherwise the mirror set will recover from a non-integrated mirror

Signed-off-by: Lidong Zhong <lzhong at suse.com>
---
 drivers/md/dm-raid1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 95ec822..db0ccb9 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -231,7 +231,7 @@ static void fail_mirror(struct mirror *m, enum dm_raid1_error error_type)
 	if (m != get_default_mirror(ms))
 		goto out;
 
-	if (!ms->in_sync) {
+	if (!ms->in_sync && !keep_log(ms)) {
 		/*
 		 * Better to issue requests to same failing device
 		 * than to risk returning corrupt data.
-- 
1.8.1.4




More information about the dm-devel mailing list