From 1c220881e307b62cc2f77d911219de332aa3f61e Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Fri, 4 Apr 2014 17:49:12 -0700 Subject: [PATCH] rbd: make discard trigger copy-on-write 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 --- 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 835a96a09a6b..6fb93cd6957f 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2851,7 +2851,8 @@ static bool img_obj_request_simple(struct rbd_obj_request *obj_request) rbd_dev = img_request->rbd_dev; /* Reads */ - if (!img_request_write_test(img_request)) + if (!img_request_write_test(img_request) && + !img_request_discard_test(img_request)) return true; /* Non-layered writes */ -- GitLab