From: Qian Yingjin Date: Mon, 26 Nov 2018 02:11:06 +0000 (+0800) Subject: LU-11696 utils: "lfs getsom" returns "24" to userspace X-Git-Tag: 2.12.51~76 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9209e0e9428b6671c6bab9f901e04fdf5b29abc5 LU-11696 utils: "lfs getsom" returns "24" to userspace The "lfs getsom" command always returns "24" to userspace because "rc = 24" (sizeof(struct lustre_som_attrs)) after fetching the xattr from the kernel. In this patch, rc is set to 0 if the lfs_getsom()->lgetxattr() call returns a positive value. Signed-off-by: Qian Yingjin Change-Id: Ie3151f67b5ce2b5b2bc35a4b6528ba9a20a5db9f Reviewed-on: https://review.whamcloud.com/33714 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 28e7c33..e5a1ca0 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -19849,7 +19849,7 @@ test_806() { local offset=0 local i - echo "Test SOM for single client muti-threaded($num) write" + echo "Test SOM for single client multi-threaded($num) write" $TRUNCATE $DIR/$tfile 0 for ((i = 0; i < $num; i++)); do $MULTIOP $DIR/$tfile Oz${offset}w${bs}c & @@ -19878,7 +19878,7 @@ test_806() { offset=0 i=0 - echo "Test SOM for muti-client ($num) writes" + echo "Test SOM for multi-client ($num) writes" $TRUNCATE $DIR/$tfile 0 for client in ${CLIENTS//,/ }; do do_node $client $MULTIOP $DIR/$tfile Oz${offset}w${bs}c & @@ -19951,7 +19951,7 @@ test_807() { local offset=0 local i=0 - echo "Test SOM for muti-client ($num) writes" + echo "Test SOM for multi-client ($num) writes" touch $DIR/$tfile || error "touch $tfile failed" $TRUNCATE $DIR/$tfile 0 for client in ${CLIENTS//,/ }; do diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 57bc998..0cc1fed 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -9475,7 +9475,7 @@ static int lfs_getsom(int argc, char **argv) return CMD_HELP; } - return rc; + return 0; } /** diff --git a/lustre/utils/llsom_sync.c b/lustre/utils/llsom_sync.c index 9676ded..1c2e5c3 100644 --- a/lustre/utils/llsom_sync.c +++ b/lustre/utils/llsom_sync.c @@ -51,10 +51,6 @@ #include #include -#ifndef PATH_MAX -#define PATH_MAX (4096) -#endif - #define container_of(ptr, type, member) ({ \ const typeof(((type *) 0)->member) * __mptr = (ptr); \ (type *) ((char *) __mptr - offsetof(type, member)); })