Skip to content

Commit

Permalink
rbd: make discard trigger copy-on-write
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jdurgin authored and idryomov committed Oct 14, 2014
1 parent d0265de commit 1c22088
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 1c22088

Please sign in to comment.