Skip to content
Snippets Groups Projects
Commit 206796d5 authored by Nathan Rutman's avatar Nathan Rutman
Browse files

b=13542

i=deen
i=tianzy
the reply state was leaked in the no_reply case
parent a1c17348
No related merge requests found
...@@ -669,7 +669,7 @@ static int ost_brw_read(struct ptlrpc_request *req, struct obd_trans_info *oti) ...@@ -669,7 +669,7 @@ static int ost_brw_read(struct ptlrpc_request *req, struct obd_trans_info *oti)
struct l_wait_info lwi; struct l_wait_info lwi;
struct lustre_handle lockh = { 0 }; struct lustre_handle lockh = { 0 };
int size[2] = { sizeof(struct ptlrpc_body), sizeof(*body) }; int size[2] = { sizeof(struct ptlrpc_body), sizeof(*body) };
int comms_error = 0, niocount, npages, nob = 0, rc, i; int niocount, npages, nob = 0, rc, i;
int no_reply = 0; int no_reply = 0;
ENTRY; ENTRY;
...@@ -758,7 +758,7 @@ static int ost_brw_read(struct ptlrpc_request *req, struct obd_trans_info *oti) ...@@ -758,7 +758,7 @@ static int ost_brw_read(struct ptlrpc_request *req, struct obd_trans_info *oti)
"object "LPX64" took %ld seconds.\n", "object "LPX64" took %ld seconds.\n",
libcfs_id2str(req->rq_peer), ioo->ioo_id, libcfs_id2str(req->rq_peer), ioo->ioo_id,
cfs_time_current_sec() - req->rq_arrival_time.tv_sec); cfs_time_current_sec() - req->rq_arrival_time.tv_sec);
goto out_lock; GOTO(out_lock, rc = -ETIMEDOUT);
} }
rc = obd_preprw(OBD_BRW_READ, req->rq_export, &body->oa, 1, rc = obd_preprw(OBD_BRW_READ, req->rq_export, &body->oa, 1,
...@@ -842,7 +842,7 @@ static int ost_brw_read(struct ptlrpc_request *req, struct obd_trans_info *oti) ...@@ -842,7 +842,7 @@ static int ost_brw_read(struct ptlrpc_request *req, struct obd_trans_info *oti)
} else { } else {
DEBUG_REQ(D_ERROR, req, "bulk PUT failed: rc %d", rc); DEBUG_REQ(D_ERROR, req, "bulk PUT failed: rc %d", rc);
} }
comms_error = rc != 0; no_reply = rc != 0;
} }
/* Must commit after prep above in all cases */ /* Must commit after prep above in all cases */
...@@ -861,15 +861,13 @@ out_lock: ...@@ -861,15 +861,13 @@ out_lock:
ost_brw_lock_put(LCK_PR, ioo, pp_rnb, &lockh); ost_brw_lock_put(LCK_PR, ioo, pp_rnb, &lockh);
out_bulk: out_bulk:
ptlrpc_free_bulk(desc); ptlrpc_free_bulk(desc);
if (no_reply)
RETURN(rc);
out: out:
LASSERT(rc <= 0); LASSERT(rc <= 0);
if (rc == 0) { if (rc == 0) {
req->rq_status = nob; req->rq_status = nob;
target_committed_to_req(req); target_committed_to_req(req);
ptlrpc_reply(req); ptlrpc_reply(req);
} else if (!comms_error) { } else if (!no_reply) {
/* Only reply if there was no comms problem with bulk */ /* Only reply if there was no comms problem with bulk */
target_committed_to_req(req); target_committed_to_req(req);
req->rq_status = rc; req->rq_status = rc;
...@@ -904,7 +902,7 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti) ...@@ -904,7 +902,7 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
struct lustre_capa *capa = NULL; struct lustre_capa *capa = NULL;
__u32 *rcs; __u32 *rcs;
int size[3] = { sizeof(struct ptlrpc_body), sizeof(*body) }; int size[3] = { sizeof(struct ptlrpc_body), sizeof(*body) };
int objcount, niocount, npages, comms_error = 0; int objcount, niocount, npages;
int rc, swab, i, j; int rc, swab, i, j;
obd_count client_cksum, server_cksum = 0; obd_count client_cksum, server_cksum = 0;
int no_reply = 0; int no_reply = 0;
...@@ -1017,7 +1015,7 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti) ...@@ -1017,7 +1015,7 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
"object "LPX64" took %ld seconds.\n", "object "LPX64" took %ld seconds.\n",
libcfs_id2str(req->rq_peer), ioo->ioo_id, libcfs_id2str(req->rq_peer), ioo->ioo_id,
cfs_time_current_sec() - req->rq_arrival_time.tv_sec); cfs_time_current_sec() - req->rq_arrival_time.tv_sec);
goto out_lock; GOTO(out_lock, rc = -ETIMEDOUT);
} }
ost_prolong_locks(req->rq_export, ioo, pp_rnb, LCK_PW); ost_prolong_locks(req->rq_export, ioo, pp_rnb, LCK_PW);
...@@ -1076,7 +1074,7 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti) ...@@ -1076,7 +1074,7 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
} else { } else {
DEBUG_REQ(D_ERROR, req, "ptlrpc_bulk_get failed: rc %d", rc); DEBUG_REQ(D_ERROR, req, "ptlrpc_bulk_get failed: rc %d", rc);
} }
comms_error = rc != 0; no_reply = rc != 0;
repbody = lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF, repbody = lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF,
sizeof(*repbody)); sizeof(*repbody));
...@@ -1170,14 +1168,12 @@ out_lock: ...@@ -1170,14 +1168,12 @@ out_lock:
ost_brw_lock_put(LCK_PW, ioo, pp_rnb, &lockh); ost_brw_lock_put(LCK_PW, ioo, pp_rnb, &lockh);
out_bulk: out_bulk:
ptlrpc_free_bulk(desc); ptlrpc_free_bulk(desc);
if (no_reply)
RETURN(rc);
out: out:
if (rc == 0) { if (rc == 0) {
oti_to_request(oti, req); oti_to_request(oti, req);
target_committed_to_req(req); target_committed_to_req(req);
rc = ptlrpc_reply(req); rc = ptlrpc_reply(req);
} else if (!comms_error) { } else if (!no_reply) {
/* Only reply if there was no comms problem with bulk */ /* Only reply if there was no comms problem with bulk */
target_committed_to_req(req); target_committed_to_req(req);
req->rq_status = rc; req->rq_status = rc;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment