X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Flov%2Flov_obd.c;h=f293cfd042b30dc14fb847bc3892c8f0eac2040b;hp=c31295e9720146f138efc9060de724f8576f80d9;hb=a25adb47c7b7eeb68a922e2647d74eeff3401c6a;hpb=7e4673aeb348677a770bf686a13780c873becf7f diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index c31295e..f293cfd 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -1846,6 +1846,7 @@ static int lov_enqueue(struct obd_export *exp, struct obd_info *oinfo, struct ldlm_enqueue_info *einfo, struct ptlrpc_request_set *rqset) { + ldlm_mode_t mode = einfo->ei_mode; struct lov_request_set *set; struct lov_request *req; struct list_head *pos; @@ -1855,6 +1856,7 @@ static int lov_enqueue(struct obd_export *exp, struct obd_info *oinfo, LASSERT(oinfo); ASSERT_LSM_MAGIC(oinfo->oi_md); + LASSERT(mode == (mode & -mode)); /* we should never be asked to replay a lock this way. */ LASSERT((oinfo->oi_flags & LDLM_FL_REPLAY) == 0); @@ -1884,7 +1886,7 @@ static int lov_enqueue(struct obd_export *exp, struct obd_info *oinfo, RETURN(rc); } out: - rc = lov_fini_enqueue_set(set, einfo->ei_mode, rc, rqset); + rc = lov_fini_enqueue_set(set, mode, rc, rqset); RETURN(rc); } @@ -1902,6 +1904,7 @@ static int lov_match(struct obd_export *exp, struct lov_stripe_md *lsm, ENTRY; ASSERT_LSM_MAGIC(lsm); + LASSERT((*flags & LDLM_FL_TEST_LOCK) || mode == (mode & -mode)); if (!exp || !exp->exp_obd) RETURN(-ENODEV); @@ -1924,7 +1927,7 @@ static int lov_match(struct obd_export *exp, struct lov_stripe_md *lsm, req->rq_oi.oi_md, type, &sub_policy, mode, &lov_flags, data, lov_lockhp); rc = lov_update_match_set(set, req, rc); - if (rc != 1) + if (rc <= 0) break; } lov_fini_match_set(set, mode, *flags);