Re: [PATCH v2] mdadm/grow: adding a test to ensure resize was required

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

 





On 10/12/2017 03:44 AM, John Stoffel wrote:
"Zhilong" == Zhilong Liu <zlliu@xxxxxxxx> writes:
Zhilong> To fix the commit: 4b74a905a67e
Zhilong> (mdadm/grow: Component size must be larger than chunk size)

Zhilong> array.level > 1 : against the raids which chunk_size is meaningful.
s-> size > 0 : ensure that changing component size has required.
Zhilong> array.chunk_size / 1024 > s->size : ensure component size should
Zhilong> be always >= current chunk_size when requires resize, otherwise,
mddev-> pers->resize would be set mddev->dev_sectors as '0'.

Is there any possibility of setting up a test harness that could be
used to check for problems like this automatically?  Sorta like the
xfstests that the filesystem people run?

Agree your suggestions, it's still many works to do in our test part, I have
done a little bit, but daily-work always take more time.
mdadm needs many reliable 'unit test cases' to support, I would continue
to do this once I have time.
Against this patch, I would re-draft the test case of 'tests/02r5grow', it can
cover to test this scenario.


I don't know if you've seen the discussion (I know Jes has) about
mdadm --grow allowing you to reduce an array size enough to nuke the
superblocks, so I wonder if this fix will also apply to that problem?

Sorry for that, I have no memory with this issue. I do appreciate that if
have detail example here.

Thanks,
-Zhilong


Zhilong> Reported-by: Tomasz Majchrzak <tomasz.majchrzak@xxxxxxxxx>
Zhilong> Suggested-by: NeilBrown <neilb@xxxxxxxx>
Zhilong> Signed-off-by: Zhilong Liu <zlliu@xxxxxxxx>
Zhilong> ---

Zhilong> v1: [PATCH 1/3] mdadm/Grow: fix the broken raid level conversion

Zhilong> changes:
Zhilong>   correct the test 's->level == UnSet' as 's->size > 0'

Zhilong>  Grow.c | 1 +
Zhilong>  1 file changed, 1 insertion(+)

Zhilong> diff --git a/Grow.c b/Grow.c
Zhilong> index 4d79d83..8c2d50c 100644
Zhilong> --- a/Grow.c
Zhilong> +++ b/Grow.c
Zhilong> @@ -1810,6 +1810,7 @@ int Grow_reshape(char *devname, int fd,
Zhilong>  	}
Zhilong> if (array.level > 1 &&
Zhilong> +	    s->size > 0 &&
Zhilong>  	   (array.chunk_size / 1024) > (int)s->size) {
Zhilong>  		pr_err("component size must be larger than chunk size.\n");
Zhilong>  		return 1;
Zhilong> --
Zhilong> 2.6.6

Zhilong> --
Zhilong> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
Zhilong> the body of a message to majordomo@xxxxxxxxxxxxxxx
Zhilong> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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