From 404bb62da49ca33bdc6e287a12e69d086a1fa4c2 Mon Sep 17 00:00:00 2001 From: Serguei Smirnov Date: Thu, 24 Sep 2020 16:49:05 -0700 Subject: [PATCH] LU-13701 utils: fix usage of getopt_long in portals 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 Change-Id: Ibef6ba347a90d9ed3cd4bd9346ed9f79f0120b87 Reviewed-on: https://review.whamcloud.com/40036 Tested-by: jenkins Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Chris Horn Reviewed-by: Oleg Drokin --- lustre/tests/sanity-lnet.sh | 6 ------ lustre/utils/portals.c | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lustre/tests/sanity-lnet.sh b/lustre/tests/sanity-lnet.sh index ec536cc..70d8b08 100755 --- a/lustre/tests/sanity-lnet.sh +++ b/lustre/tests/sanity-lnet.sh @@ -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)} diff --git a/lustre/utils/portals.c b/lustre/utils/portals.c index 4349577..a0220a6 100644 --- a/lustre/utils/portals.c +++ b/lustre/utils/portals.c @@ -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; -- 1.8.3.1