diff options
author | Josh Durgin <josh.durgin@inktank.com> | 2014-04-04 20:49:12 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@redhat.com> | 2014-10-14 13:03:34 -0400 |
commit | 1c220881e307b62cc2f77d911219de332aa3f61e (patch) | |
tree | 6ce1baba2f79c5560f2a531fa7b6560702787250 | |
parent | d0265de7c358d71a494dcd1ee28206b32754bb0f (diff) |
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 <josh.durgin@inktank.com>
-rw-r--r-- | drivers/block/rbd.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) | |||
2851 | rbd_dev = img_request->rbd_dev; | 2851 | rbd_dev = img_request->rbd_dev; |
2852 | 2852 | ||
2853 | /* Reads */ | 2853 | /* Reads */ |
2854 | if (!img_request_write_test(img_request)) | 2854 | if (!img_request_write_test(img_request) && |
2855 | !img_request_discard_test(img_request)) | ||
2855 | return true; | 2856 | return true; |
2856 | 2857 | ||
2857 | /* Non-layered writes */ | 2858 | /* Non-layered writes */ |