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

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