aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/rbd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 94747afc2e78..34a981ba1b9e 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1382,6 +1382,13 @@ static void rbd_obj_request_put(struct rbd_obj_request *obj_request)
1382 kref_put(&obj_request->kref, rbd_obj_request_destroy); 1382 kref_put(&obj_request->kref, rbd_obj_request_destroy);
1383} 1383}
1384 1384
1385static void rbd_img_request_get(struct rbd_img_request *img_request)
1386{
1387 dout("%s: img %p (was %d)\n", __func__, img_request,
1388 atomic_read(&img_request->kref.refcount));
1389 kref_get(&img_request->kref);
1390}
1391
1385static bool img_request_child_test(struct rbd_img_request *img_request); 1392static bool img_request_child_test(struct rbd_img_request *img_request);
1386static void rbd_parent_request_destroy(struct kref *kref); 1393static void rbd_parent_request_destroy(struct kref *kref);
1387static void rbd_img_request_destroy(struct kref *kref); 1394static void rbd_img_request_destroy(struct kref *kref);
@@ -2142,6 +2149,7 @@ static void rbd_img_obj_callback(struct rbd_obj_request *obj_request)
2142 img_request->next_completion = which; 2149 img_request->next_completion = which;
2143out: 2150out:
2144 spin_unlock_irq(&img_request->completion_lock); 2151 spin_unlock_irq(&img_request->completion_lock);
2152 rbd_img_request_put(img_request);
2145 2153
2146 if (!more) 2154 if (!more)
2147 rbd_img_request_complete(img_request); 2155 rbd_img_request_complete(img_request);
@@ -2242,6 +2250,7 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request,
2242 goto out_unwind; 2250 goto out_unwind;
2243 obj_request->osd_req = osd_req; 2251 obj_request->osd_req = osd_req;
2244 obj_request->callback = rbd_img_obj_callback; 2252 obj_request->callback = rbd_img_obj_callback;
2253 rbd_img_request_get(img_request);
2245 2254
2246 if (write_request) { 2255 if (write_request) {
2247 osd_req_op_alloc_hint_init(osd_req, which, 2256 osd_req_op_alloc_hint_init(osd_req, which,