All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kinga Tanska <kinga.tanska@intel.com>
To: linux-raid@vger.kernel.org
Cc: jes@trained-monkey.org, colyli@suse.de
Subject: [PATCH v3 1/2] Assemble: check if device is container before scheduling force-clean update
Date: Tue,  5 Jul 2022 13:58:11 +0200	[thread overview]
Message-ID: <20220705115812.6946-2-kinga.tanska@intel.com> (raw)
In-Reply-To: <20220705115812.6946-1-kinga.tanska@intel.com>

When assemble is used with --force flag and array is not clean then
"force-clean" update is scheduled. Containers are considered as not
clean because this field is not set for them. To exclude them from
meaningless update (it is ignored quietly) check if the device
is a container first.

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);
-- 
2.26.2


  reply	other threads:[~2022-07-05 11:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 11:58 [PATCH v3 0/2] Fix force assemblation Kinga Tanska
2022-07-05 11:58 ` Kinga Tanska [this message]
2022-07-05 11:58 ` [PATCH v3 2/2] mdadm: replace container level checking with inline Kinga Tanska
  -- strict thread matches above, loose matches on Subject: below --
2022-08-18  7:20 [PATCH v3 0/2] Fix force addemblation Kinga Tanska
2022-08-18  7:20 ` [PATCH v3 1/2] Assemble: check if device is container before scheduling force-clean update Kinga Tanska
2022-08-19  0:55 [PATCH v3 0/2] Fix force assemblation Kinga Tanska
2022-08-19  0:55 ` [PATCH v3 1/2] Assemble: check if device is container before scheduling force-clean update Kinga Tanska
2022-08-24 16:01   ` Jes Sorensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220705115812.6946-2-kinga.tanska@intel.com \
    --to=kinga.tanska@intel.com \
    --cc=colyli@suse.de \
    --cc=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.