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

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