From 4e7fd8821da4da2148c5044f416e390c42faf3b8 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 20 May 2020 12:19:32 -0600 Subject: [PATCH 1/1] LU-13589 utils: fix lfs setstripe unit parsing The "size_units" variable was not being reset while parsing different "lfs setstripe" arguments, so e.g. "lfs setstripe -E 1M -S 65536 ..." ended up using the 'M' unit for the stripe size, which resulted in a stripe_size of 65536MiB = 64GiB, which resulted in an error. This only appeared with PFL or other layout patterns which had more than one unit being parsed, and was already fixed in master via SEL. Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: Ib3f9be86f5104aaea4f77d87853255a518cbc3a0 Reviewed-on: https://review.whamcloud.com/38680 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Emoly Liu Reviewed-by: Oleg Drokin --- lustre/utils/lfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 9616c2f..f4ef2f1 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -2801,6 +2801,7 @@ static int lfs_setstripe_internal(int argc, char **argv, while ((c = getopt_long(argc, argv, "bc:dDE:f:H:i:I:m:N::no:p:L:s:S:vy:", long_opts, NULL)) >= 0) { + size_units = 1; switch (c) { case 0: /* Long options. */ -- 1.8.3.1