summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7e915f5)
If there are no objects to be scanned just at the LFSCK beginning,
then the LFSCK should mark the otable-based iteration as finished
to avoid to access non-initialized data via dt_it_ops::rec().
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I67e880ccfa13e867c4ca7f1858d67909ba0415b3
Reviewed-on: http://review.whamcloud.com/5622
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
else if (IS_ERR(obj))
return PTR_ERR(obj);
else if (IS_ERR(obj))
return PTR_ERR(obj);
- /* XXX: need more processing for remote object in the future. */
- if (!mdd_object_exists(obj) || mdd_object_remote(obj)) {
+ if (!mdd_object_exists(obj)) {
mdd_object_put(env, obj);
return 0;
}
mdd_object_put(env, obj);
return 0;
}
+ /* Currently, only client visible directory can be remote. */
+ if (mdd_object_remote(obj)) {
+ mdd_object_put(env, obj);
+ return 1;
+ }
+
/* Init otable-based iterator. */
if (pos == NULL) {
rc = iops->load(env, lfsck->ml_di_oit, 0);
/* Init otable-based iterator. */
if (pos == NULL) {
rc = iops->load(env, lfsck->ml_di_oit, 0);
- GOTO(out, rc = (rc >= 0 ? 0 : rc));
+ if (rc > 0) {
+ lfsck->ml_oit_over = 1;
+ rc = 0;
+ }
+
+ GOTO(out, rc);
}
rc = iops->load(env, lfsck->ml_di_oit, pos->lp_oit_cookie);
if (rc < 0)
GOTO(out, rc);
}
rc = iops->load(env, lfsck->ml_di_oit, pos->lp_oit_cookie);
if (rc < 0)
GOTO(out, rc);
+ else if (rc > 0)
+ lfsck->ml_oit_over = 1;
if (fid_is_zero(&pos->lp_dir_parent))
GOTO(out, rc = 0);
if (fid_is_zero(&pos->lp_dir_parent))
GOTO(out, rc = 0);
struct osd_otable_cache *ooc = &it->ooi_cache;
*(struct lu_fid *)rec = ooc->ooc_cache[ooc->ooc_consumer_idx].oic_fid;
struct osd_otable_cache *ooc = &it->ooi_cache;
*(struct lu_fid *)rec = ooc->ooc_cache[ooc->ooc_consumer_idx].oic_fid;
+
+ /* Filter out Invald FID already. */
+ LASSERTF(fid_is_sane((struct lu_fid *)rec),
+ "Invalid FID "DFID", p_idx = %d, c_idx = %d\n",
+ PFID((struct lu_fid *)rec),
+ ooc->ooc_producer_idx, ooc->ooc_consumer_idx);
+