* [PATCH] rbd: end request on error in rbd_do_request() caller
@ 2012-11-08 14:12 Alex Elder
0 siblings, 0 replies; only message in thread
From: Alex Elder @ 2012-11-08 14:12 UTC (permalink / raw)
To: ceph-devel@vger.kernel.org
Only one of the three callers of rbd_do_request() provide a
collection structure to aggregate status.
If an error occurs in rbd_do_request(), have the caller
take care of calling rbd_coll_end_req() if necessary in
that one spot.
Signed-off-by: Alex Elder <elder@inktank.com>
---
drivers/block/rbd.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index fb727c0..835153e 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1128,12 +1128,8 @@ static int rbd_do_request(struct request *rq,
struct ceph_osd_client *osdc;
rbd_req = kzalloc(sizeof(*rbd_req), GFP_NOIO);
- if (!rbd_req) {
- if (coll)
- rbd_coll_end_req_index(rq, coll, coll_index,
- (s32) -ENOMEM, len);
+ if (!rbd_req)
return -ENOMEM;
- }
if (coll) {
rbd_req->coll = coll;
@@ -1208,7 +1204,6 @@ done_err:
bio_chain_put(rbd_req->bio);
ceph_osdc_put_request(osd_req);
done_pages:
- rbd_coll_end_req(rbd_req, (s32) ret, len);
kfree(rbd_req);
return ret;
}
@@ -1361,7 +1356,9 @@ static int rbd_do_op(struct request *rq,
ops,
coll, coll_index,
rbd_req_cb, 0, NULL);
-
+ if (ret < 0)
+ rbd_coll_end_req_index(rq, coll, coll_index,
+ (s32) ret, seg_len);
rbd_destroy_ops(ops);
done:
kfree(seg_name);
--
1.7.9.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-11-08 14:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08 14:12 [PATCH] rbd: end request on error in rbd_do_request() caller Alex Elder
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.