Whamcloud - gitweb
LU-16553 utils: cleanup lfs options 92/49992/2
authorTimothy Day <timday@amazon.com>
Wed, 8 Feb 2023 17:27:16 +0000 (17:27 +0000)
committerOleg Drokin <green@whamcloud.com>
Wed, 1 Mar 2023 06:18:47 +0000 (06:18 +0000)
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 <timday@amazon.com>
Change-Id: I9144b2d68291811edf95b9d912fbbb8fe0266392
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49992
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/lfs.c

index 999e635..197ccee 100644 (file)
@@ -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;