Blame SOURCES/0052-Assemble-check-if-device-is-container-before-schedul.patch

c0f891
From 5c3c3df646dd3b7e8df81152f08e9ac4ddccc671 Mon Sep 17 00:00:00 2001
c0f891
From: Kinga Tanska <kinga.tanska@intel.com>
c0f891
Date: Fri, 19 Aug 2022 02:55:46 +0200
37f2b0
Subject: [PATCH 52/83] Assemble: check if device is container before
c0f891
 scheduling force-clean update
c0f891
c0f891
Up to now using assemble with force flag making each array as clean.
c0f891
Force-clean should not be done for the container. This commit add
c0f891
check if device is different than container before cleaning.
c0f891
c0f891
Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
c0f891
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
c0f891
---
c0f891
 Assemble.c | 5 ++---
c0f891
 1 file changed, 2 insertions(+), 3 deletions(-)
c0f891
c0f891
diff --git a/Assemble.c b/Assemble.c
c0f891
index be2160b4..1dd82a8c 100644
c0f891
--- a/Assemble.c
c0f891
+++ b/Assemble.c
c0f891
@@ -1809,10 +1809,9 @@ try_again:
c0f891
 		}
c0f891
 #endif
c0f891
 	}
c0f891
-	if (c->force && !clean &&
c0f891
+	if (c->force && !clean && content->array.level != LEVEL_CONTAINER &&
c0f891
 	    !enough(content->array.level, content->array.raid_disks,
c0f891
-		    content->array.layout, clean,
c0f891
-		    avail)) {
c0f891
+		    content->array.layout, clean, avail)) {
c0f891
 		change += st->ss->update_super(st, content, "force-array",
c0f891
 					       devices[chosen_drive].devname, c->verbose,
c0f891
 					       0, NULL);
c0f891
-- 
37f2b0
2.38.1
c0f891