Discard requests are a form of write, so they should go through the
same process as plain write requests and trigger copy-on-write for
layered images.

Signed-off-by: Josh Durgin <[email protected]>
---
 drivers/block/rbd.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 4f6f48a..78433df 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2755,7 +2755,8 @@ static bool rbd_img_obj_request_simple(struct 
rbd_obj_request *obj_request)
        obj_size = (u64) 1 << rbd_dev->header.obj_order;
 
        /* Read requests didn't need special handling */
-       if (!img_request_write_test(img_request))
+       if (!img_request_write_test(img_request) &&
+               !img_request_discard_test(img_request))
                return true;
        /* No-layered writes are simple requests*/
        if (!img_request_layered_test(img_request))
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to