Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c220881 authored by Josh Durgin's avatar Josh Durgin Committed by Ilya Dryomov
Browse files

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: default avatarJosh Durgin <josh.durgin@inktank.com>
parent d0265de7
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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 */