Whamcloud - gitweb
LU-14119 osd-zfs: enable LUDA_VERIFY 74/41274/3
authorLai Siyao <lai.siyao@whamcloud.com>
Tue, 19 Jan 2021 13:37:50 +0000 (21:37 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 6 Apr 2021 03:02:31 +0000 (03:02 +0000)
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 <lai.siyao@whamcloud.com>
Change-Id: I35e2a4d4606044cd37cc5847cffc577740918988
Reviewed-on: https://review.whamcloud.com/41274
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-zfs/osd_index.c

index 9116cba..9f4ee37 100644 (file)
@@ -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;