From 9968be808016bd2f5e349bc4c2216c445d0d65ad Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Wed, 8 Feb 2023 17:27:16 +0000 Subject: [PATCH] LU-16553 utils: cleanup lfs options The enums for lfs long options should start after the char range. This is supported by getopt_long and used by lustre/test/statx.c. I didn't see this issue in any of the other uses of getopt_long, so this is the only place this fix needs to be made. Also, enable stats when stats_interval is used. Signed-off-by: Timothy Day Change-Id: I9144b2d68291811edf95b9d912fbbb8fe0266392 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49992 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- lustre/utils/lfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 999e635..197ccee 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -3491,8 +3491,8 @@ static void lfs_mirror_list_free(struct mirror_args *mirror_list) } enum { - LFS_SETQUOTA_DELETE = 1, - LFS_POOL_OPT = 3, + LFS_SETQUOTA_DELETE = (CHAR_MAX + 1), + LFS_POOL_OPT, LFS_COMP_COUNT_OPT, LFS_COMP_START_OPT, LFS_COMP_FLAGS_OPT, @@ -3826,6 +3826,7 @@ static int lfs_setstripe_internal(int argc, char **argv, stats_flag = STATS_ON; break; case LFS_STATS_INTERVAL_OPT: + stats_flag = STATS_ON; stats_interval_sec = strtol(optarg, &end, 0); if (stats_interval_sec == 0) stats_interval_sec = 5; -- 1.8.3.1