From e01542872c8e3baf613a58633bddc981132db13f Mon Sep 17 00:00:00 2001 From: wangdi Date: Wed, 11 Oct 2006 08:08:51 +0000 Subject: [PATCH] Branch: b_new_cmd fix the problem in reset hash segment --- lustre/lmv/lmv_obd.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index e295cdd..a39b275 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -1949,17 +1949,16 @@ static int lmv_reset_hash_seg_end (struct lmv_obd *lmv, struct lmv_obj *obj, GOTO(cleanup, rc = 0); if (rc != -ERANGE) GOTO(cleanup, rc); - if (rc == -ERANGE) - rc = 0; } kmap(page); next_dp = cfs_page_address(page); LASSERT(le32_to_cpu(next_dp->ldp_hash_start) >= seg_end); dp->ldp_hash_end = next_dp->ldp_hash_start; kunmap(page); - CDEBUG(D_INFO,"reset h_end %x for split obj"DFID"o_count %d index %d\n", + CDEBUG(D_INFO,"reset h_end %x split obj"DFID"o_count %d index %d\n", le32_to_cpu(dp->ldp_hash_end), PFID(&rid), obj->lo_objcount, index); + rc = 1; cleanup: if (tmp_req) ptlrpc_req_finished(tmp_req); @@ -2024,11 +2023,14 @@ static int lmv_readpage(struct obd_export *exp, const struct lu_fid *fid, do { rc = lmv_reset_hash_seg_end(lmv, obj, fid, ++i, dp); - if (i >= obj->lo_objcount - 1) + if (i >= obj->lo_objcount - 1 || rc) { + if (rc == 1) + rc = 0; break; + } /* if there are no entries in this segment * and it is not the last hash segment */ - } while (rc != -E2BIG); + } while (1); } kunmap(page); } -- 1.8.3.1