Whamcloud - gitweb
LU-11696 utils: "lfs getsom" returns "24" to userspace 14/33714/2
authorQian Yingjin <qian@ddn.com>
Mon, 26 Nov 2018 02:11:06 +0000 (10:11 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 4 Jan 2019 04:48:07 +0000 (04:48 +0000)
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 <qian@ddn.com>
Change-Id: Ie3151f67b5ce2b5b2bc35a4b6528ba9a20a5db9f
Reviewed-on: https://review.whamcloud.com/33714
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh
lustre/utils/lfs.c
lustre/utils/llsom_sync.c

index 28e7c33..e5a1ca0 100755 (executable)
@@ -19849,7 +19849,7 @@ test_806() {
        local offset=0
        local i
 
        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 &
        $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
 
        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 &
        $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
 
        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
        touch $DIR/$tfile || error "touch $tfile failed"
        $TRUNCATE $DIR/$tfile 0
        for client in ${CLIENTS//,/ }; do
index 57bc998..0cc1fed 100644 (file)
@@ -9475,7 +9475,7 @@ static int lfs_getsom(int argc, char **argv)
                return CMD_HELP;
        }
 
                return CMD_HELP;
        }
 
-       return rc;
+       return 0;
 }
 
 /**
 }
 
 /**
index 9676ded..1c2e5c3 100644 (file)
 #include <libcfs/util/list.h>
 #include <libcfs/util/parser.h>
 
 #include <libcfs/util/list.h>
 #include <libcfs/util/parser.h>
 
-#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)); })
 #define container_of(ptr, type, member) ({                      \
        const typeof(((type *) 0)->member) * __mptr = (ptr);     \
        (type *) ((char *) __mptr - offsetof(type, member)); })