diff options
-rw-r--r-- | drivers/block/rbd.c | 9 |
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 | ||
1385 | static 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 | |||
1385 | static bool img_request_child_test(struct rbd_img_request *img_request); | 1392 | static bool img_request_child_test(struct rbd_img_request *img_request); |
1386 | static void rbd_parent_request_destroy(struct kref *kref); | 1393 | static void rbd_parent_request_destroy(struct kref *kref); |
1387 | static void rbd_img_request_destroy(struct kref *kref); | 1394 | static 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; |
2143 | out: | 2150 | out: |
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, |