Whamcloud - gitweb
LU-13701 utils: fix usage of getopt_long in portals 36/40036/4
authorSerguei Smirnov <ssmirnov@whamcloud.com>
Thu, 24 Sep 2020 23:49:05 +0000 (16:49 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 12 Oct 2020 05:47:51 +0000 (05:47 +0000)
Due to char being unsigned by default, using this type to store
the int return value of getopt_long causes parsing issues on arm
platform, seen with lctl net_drop_add options. Fix it.

Test-Parameters: trivial testgroup=review-ldiskfs-arm
Signed-off-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Change-Id: Ibef6ba347a90d9ed3cd4bd9346ed9f79f0120b87
Reviewed-on: https://review.whamcloud.com/40036
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-lnet.sh
lustre/utils/portals.c

index ec536cc..70d8b08 100755 (executable)
@@ -12,12 +12,6 @@ ONLY=${ONLY:-"$*"}
 ALWAYS_EXCEPT="$SANITY_LNET_EXCEPT "
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
-# skip test ARM testing until they are fixed
-if [[ $(uname -m) = aarch64 ]]; then
-       # bug number for skipped test: LU-13704 LU-13701 LU-13701 LU-13701
-       ALWAYS_EXCEPT+="               204      205      206      207 "
-fi
-
 [ "$SLOW" = "no" ] && EXCEPT_SLOW=""
 
 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
index 4349577..a0220a6 100644 (file)
@@ -1384,7 +1384,7 @@ fault_simul_rule_add(__u32 opc, char *name, int argc, char **argv)
        optstr = opc == LNET_CTL_DROP_ADD ? "s:d:o:r:i:p:m:e:nx" : "s:d:o:r:l:p:m:";
        memset(&attr, 0, sizeof(attr));
        while (1) {
-               char c = getopt_long(argc, argv, optstr, opts, NULL);
+               int c = getopt_long(argc, argv, optstr, opts, NULL);
 
                if (c == -1)
                        break;
@@ -1566,7 +1566,7 @@ fault_simul_rule_del(__u32 opc, char *name, int argc, char **argv)
 
        memset(&attr, 0, sizeof(attr));
        while (1) {
-               char c = getopt_long(argc, argv, "s:d:a", opts, NULL);
+               int c = getopt_long(argc, argv, "s:d:a", opts, NULL);
 
                if (c == -1 || all)
                        break;