Re: [PATCH] Assemble: check if device is container before scheduling force-clean update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/9/22 5:09 PM, Kinga Tanska wrote:
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.
To unify all containers checks in code, is_container() function is
added and propagated.

Signed-off-by: Kinga Tanska <kinga.tanska@xxxxxxxxx>


Hi Kinga,


I am fine with the above idea, except the extra is_container(). IMHO comparing directly with LEVEL_CONTAINER is fine, adding is_container() doesn't help too much.


Except for the code replacement with is_container(), it looks good to me for your fix.


---
  Assemble.c    | 10 ++++------
  Create.c      |  6 +++---
  Grow.c        |  6 +++---
  Incremental.c |  4 ++--
  mdadm.h       | 14 ++++++++++++++
  super-ddf.c   |  6 +++---
  super-intel.c |  4 ++--
  super0.c      |  2 +-
  super1.c      |  2 +-
  sysfs.c       |  2 +-
  10 files changed, 34 insertions(+), 22 deletions(-)

diff --git a/Assemble.c b/Assemble.c
index 704b8293..3d65212c 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1123,7 +1123,7 @@ static int start_array(int mdfd,
  			       i/2, mddev);
  	}

[snipped]


  	}
-	if (c->force && !clean &&
+	if (c->force && !clean && !is_container(content->array.level) &&
  	    !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);


For the above change,

Acked-by: Coly Li <colyli@xxxxxxx>


Thanks.


Coly Li

[snipped]





[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux