diff mbox series

[v3,1/2] Assemble: check if device is container before scheduling force-clean update

Message ID 20220819005547.17343-2-kinga.tanska@intel.com (mailing list archive)
State Mainlined, archived
Delegated to: Coly Li
Headers show
Series Fix force assemblation | expand

Commit Message

Kinga Tanska Aug. 19, 2022, 12:55 a.m. UTC
Up to now using assemble with force flag making each array as clean.
Force-clean should not be done for the container. This commit add
check if device is different than container before cleaning.

Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
---
 Assemble.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Jes Sorensen Aug. 24, 2022, 4:01 p.m. UTC | #1
On 8/18/22 20:55, Kinga Tanska wrote:
> Up to now using assemble with force flag making each array as clean.
> Force-clean should not be done for the container. This commit add
> check if device is different than container before cleaning.
> 
> Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
> ---
>  Assemble.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/Assemble.c b/Assemble.c
> index 704b8293..f31372db 100644
> --- a/Assemble.c
> +++ b/Assemble.c
> @@ -1813,10 +1813,9 @@ try_again:
>  		}
>  #endif
>  	}
> -	if (c->force && !clean &&
> +	if (c->force && !clean && content->array.level != LEVEL_CONTAINER &&
>  	    !enough(content->array.level, content->array.raid_disks,
> -		    content->array.layout, clean,
> -		    avail)) {
> +		    content->array.layout, clean, avail)) {
>  		change += st->ss->update_super(st, content, "force-array",
>  					       devices[chosen_drive].devname, c->verbose,
>  					       0, NULL);

Applied,

Thanks,
Jes
diff mbox series

Patch

diff --git a/Assemble.c b/Assemble.c
index 704b8293..f31372db 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1813,10 +1813,9 @@  try_again:
 		}
 #endif
 	}
-	if (c->force && !clean &&
+	if (c->force && !clean && content->array.level != LEVEL_CONTAINER &&
 	    !enough(content->array.level, content->array.raid_disks,
-		    content->array.layout, clean,
-		    avail)) {
+		    content->array.layout, clean, avail)) {
 		change += st->ss->update_super(st, content, "force-array",
 					       devices[chosen_drive].devname, c->verbose,
 					       0, NULL);