Whamcloud - gitweb
LU-13437 lmv: check stripe FID sanity 00/39600/2
authorLai Siyao <lai.siyao@whamcloud.com>
Fri, 8 May 2020 14:53:47 +0000 (22:53 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 19 Sep 2020 18:13:10 +0000 (18:13 +0000)
Striped directory layout may be broken, if some stripe FID is insane,
return -ENODEV.

Lustre-change: https://review.whamcloud.com/38560
Lustre-commit: 698a496aac51e11791717a9cbd0a86b3525f4557

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: I7ed8c7c561e34625e2cb29bfd14bc0ecf3fce46c
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/39600
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lmv/lmv_obd.c

index 090bc5d..b026ddc 100644 (file)
@@ -1596,6 +1596,9 @@ __lmv_locate_tgt(struct lmv_obd *lmv, struct lmv_stripe_md *lsm,
                *fid = oinfo->lmo_fid;
        if (mds != NULL)
                *mds = oinfo->lmo_mds;
+       /* check stripe FID is sane */
+       if (!fid_is_sane(&oinfo->lmo_fid))
+               return ERR_PTR(-ENODEV);
 
        tgt = lmv_get_target(lmv, oinfo->lmo_mds, NULL);