From: Lai Siyao Date: Tue, 19 Jan 2021 13:37:50 +0000 (+0800) Subject: LU-14119 osd-zfs: enable LUDA_VERIFY X-Git-Tag: 2.14.52~176 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F74%2F41274%2F3;p=fs%2Flustre-release.git LU-14119 osd-zfs: enable LUDA_VERIFY In osd_dir_it_rec(), if dirent is successfully got, and the FID in dirent is sane, it returns right away, however if LUDA_VERIFY|LUDA_VERIFY_DRYRUN is set, the FID in dirent should be compared with the FID in LMA, and replaced with the latter one if they are differet. Signed-off-by: Lai Siyao Change-Id: I35e2a4d4606044cd37cc5847cffc577740918988 Reviewed-on: https://review.whamcloud.com/41274 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-zfs/osd_index.c b/lustre/osd-zfs/osd_index.c index 9116cba..9f4ee37 100644 --- a/lustre/osd-zfs/osd_index.c +++ b/lustre/osd-zfs/osd_index.c @@ -1568,7 +1568,8 @@ static int osd_dir_it_rec(const struct lu_env *env, const struct dt_it *di, lde->lde_attrs |= LUDA_UNKNOWN; } - GOTO(pack_attr, rc = 0); + if (!(attr & (LUDA_VERIFY | LUDA_VERIFY_DRYRUN))) + GOTO(pack_attr, rc = 0); } if (OBD_FAIL_CHECK(OBD_FAIL_FID_LOOKUP)) @@ -1580,6 +1581,10 @@ static int osd_dir_it_rec(const struct lu_env *env, const struct dt_it *di, GOTO(pack_attr, rc = 0); } + if (za->za_num_integers >= 3 && fid_is_sane(&zde->lzd_fid) && + lu_fid_eq(&zde->lzd_fid, fid)) + GOTO(pack_attr, rc = 0); + if (!(attr & LUDA_VERIFY)) { fid_cpu_to_le(&lde->lde_fid, fid); lde->lde_attrs = LUDA_FID;