Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[firefly-linux-kernel-4.4.55.git] / drivers / block / rbd.c
index 27b71a0b72d0959e63fe2ea3efaeaaaa627a4e5d..3ec85dfce12496dd64a8ad2c37984ad61f489e25 100644 (file)
@@ -2370,8 +2370,12 @@ static void rbd_img_obj_request_fill(struct rbd_obj_request *obj_request,
                opcode = CEPH_OSD_OP_READ;
        }
 
-       osd_req_op_extent_init(osd_request, num_ops, opcode, offset, length,
-                               0, 0);
+       if (opcode == CEPH_OSD_OP_DELETE)
+               osd_req_op_init(osd_request, num_ops, opcode);
+       else
+               osd_req_op_extent_init(osd_request, num_ops, opcode,
+                                      offset, length, 0, 0);
+
        if (obj_request->type == OBJ_REQUEST_BIO)
                osd_req_op_extent_osd_data_bio(osd_request, num_ops,
                                        obj_request->bio_list, length);
@@ -3405,8 +3409,7 @@ err_rq:
        if (result)
                rbd_warn(rbd_dev, "%s %llx at %llx result %d",
                         obj_op_name(op_type), length, offset, result);
-       if (snapc)
-               ceph_put_snap_context(snapc);
+       ceph_put_snap_context(snapc);
        blk_end_request_all(rq, result);
 }