Whamcloud - gitweb
LU-16693 lod: ENODEV on setstripe with wrong OST# 87/50487/3
authorVitaly Fertman <c17818@cray.com>
Fri, 2 Dec 2022 19:41:21 +0000 (22:41 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 22 Apr 2023 17:30:53 +0000 (17:30 +0000)
ENODEV should not be returned as it is a recoverable error and
the RPC will be just resent with the same set of parameters

Also, make getstripe to print out the object list for dirs
if it is MAGIC_SPECIFIC, to see the obdidx.

HPE-bug-id: LUS-11395
Signed-off-by: Vitaly Fertman <vitaly.fertman@hpe.com>
Change-Id: Idffbf3c2b525c4e00c4b662c948460e3735445fc
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Andriy Skulysh <c17819@cray.com>
Reviewed-by: Vladimir Saveliev <vladimir.saveliev@hpe.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50487
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Sergey Cheremencev <scherementsev@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lod/lod_qos.c
lustre/tests/sanity.sh
lustre/utils/liblustreapi.c

index 77ff8dd..d5ffeb7 100644 (file)
@@ -1146,7 +1146,7 @@ static int lod_alloc_ost_list(const struct lu_env *env, struct lod_object *lo,
                __u32 ost_idx = lod_comp->llc_ostlist.op_array[array_idx];
 
                if (!test_bit(ost_idx, m->lod_ost_bitmap)) {
-                       rc = -ENODEV;
+                       rc = -EINVAL;
                        break;
                }
 
index 0d23256..0858a23 100755 (executable)
@@ -2597,6 +2597,12 @@ test_27Cf() {
 }
 run_test 27Cf "test default inheritance with overstriping"
 
+test_27Cg() {
+       $LFS setstripe -o 0,$OSTCOUNT $DIR/$tfile
+       [ $? -ne 0 ] || error "must be an error for not existent OST#"
+}
+run_test 27Cg "test setstripe with wrong OST idx"
+
 test_27D() {
        [ $OSTCOUNT -lt 2 ] && skip_env "needs >= 2 OSTs"
        [ -n "$FILESET" ] && skip "SKIP due to FILESET set"
index f32a8ef..43003de 100644 (file)
@@ -2923,9 +2923,10 @@ void lov_dump_user_lmm_v1v3(struct lov_user_md *lum, char *pool_name,
        lov_dump_user_lmm_header(lum, path, objects, verbose, depth, pool_name,
                                 flags);
 
-       if (!is_dir && !skip_objs && (verbose & VERBOSE_OBJID) &&
-           !(lum->lmm_pattern & LOV_PATTERN_F_RELEASED ||
-             lov_pattern(lum->lmm_pattern) == LOV_PATTERN_MDT)) {
+       if (!skip_objs && (verbose & VERBOSE_OBJID) &&
+           ((!is_dir && !(lum->lmm_pattern & LOV_PATTERN_F_RELEASED ||
+                          lov_pattern(lum->lmm_pattern) == LOV_PATTERN_MDT)) ||
+            (is_dir && (lum->lmm_magic == LOV_USER_MAGIC_SPECIFIC)))) {
                char *space = "      - ";
 
                if (indent)
@@ -2963,6 +2964,10 @@ void lov_dump_user_lmm_v1v3(struct lov_user_md *lum, char *pool_name,
                                    "%s%3d: { l_ost_idx: %#5x, l_fid: "DFID" }\n" :
                                    "%s%3d: { l_ost_idx: %3d, l_fid: "DFID" }\n",
                                    space, i, idx, PFID(&fid));
+                       } else if (is_dir) {
+                               llapi_printf(LLAPI_MSG_NORMAL,
+                                            "\t%6u\t%14s\t%13s\t%14s\n", idx, "N/A",
+                                            "N/A", "N/A");
                        } else {
                                char fmt[48] = { 0 };