From: Vitaly Fertman Date: Fri, 2 Dec 2022 19:41:21 +0000 (+0300) Subject: LU-16693 lod: ENODEV on setstripe with wrong OST# X-Git-Tag: 2.15.56~141 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d96b98ee6b63;p=fs%2Flustre-release.git LU-16693 lod: ENODEV on setstripe with wrong OST# 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 Change-Id: Idffbf3c2b525c4e00c4b662c948460e3735445fc Reviewed-by: Alexander Boyko Reviewed-by: Andriy Skulysh Reviewed-by: Vladimir Saveliev Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50487 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Sergey Cheremencev Reviewed-by: Oleg Drokin --- diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c index 77ff8dd..d5ffeb7 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -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; } diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 0d23256..0858a23 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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" diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index f32a8ef..43003de 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -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 };