@@ -2123,6 +2123,7 @@ static void rbd_img_obj_callback(struct rbd_obj_request *obj_request)
rbd_assert(obj_request_img_data_test(obj_request));
img_request = obj_request->img_request;
+ spin_lock_irq(&img_request->completion_lock);
dout("%s: img %p obj %p\n", __func__, img_request, obj_request);
rbd_assert(img_request != NULL);
rbd_assert(img_request->obj_request_count > 0);
@@ -2130,7 +2131,6 @@ static void rbd_img_obj_callback(struct rbd_obj_request *obj_request)
rbd_assert(which < img_request->obj_request_count);
rbd_assert(which >= img_request->next_completion);
- spin_lock_irq(&img_request->completion_lock);
if (which != img_request->next_completion)
goto out;