From: Lai Siyao Date: Fri, 8 May 2020 14:53:47 +0000 (+0800) Subject: LU-13437 lmv: check stripe FID sanity X-Git-Tag: 2.13.55~177 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=698a496aac51e11791717a9cbd0a86b3525f4557 LU-13437 lmv: check stripe FID sanity Striped directory layout may be broken, if some stripe FID is insane, return -ENODEV. Signed-off-by: Lai Siyao Change-Id: I7ed8c7c561e34625e2cb29bfd14bc0ecf3fce46c Reviewed-on: https://review.whamcloud.com/38560 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Hongchao Zhang Reviewed-by: Oleg Drokin --- diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 062a44a..3a2db46 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -1569,6 +1569,10 @@ lmv_locate_tgt_by_name(struct lmv_obd *lmv, struct lmv_stripe_md *lsm, return ERR_CAST(oinfo); } + /* check stripe FID is sane */ + if (!fid_is_sane(&oinfo->lmo_fid)) + return ERR_PTR(-ENODEV); + *fid = oinfo->lmo_fid; *mds = oinfo->lmo_mds; tgt = lmv_tgt(lmv, oinfo->lmo_mds);