rbd: don't treat CEPH_OSD_OP_DELETE as extent op
authorIlya Dryomov <idryomov@redhat.com>
Fri, 21 Nov 2014 19:16:43 +0000 (22:16 +0300)
committerIlya Dryomov <idryomov@redhat.com>
Wed, 17 Dec 2014 17:09:51 +0000 (20:09 +0300)
CEPH_OSD_OP_DELETE is not an extent op, stop treating it as such.  This
sneaked in with discard patches - it's one of the three osd ops (the
other two are CEPH_OSD_OP_TRUNCATE and CEPH_OSD_OP_ZERO) that discard
is implemented with.

Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
Reviewed-by: Alex Elder <elder@linaro.org>
drivers/block/rbd.c

index 3c34ab5..3ec85df 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);