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

Commit fad2d4ef authored by Bart Van Assche's avatar Bart Van Assche Committed by Jens Axboe
Browse files

drbd: Fix drbd_request_prepare() discard handling



Fix the test that verifies whether bio_op(bio) represents a discard
or write zeroes operation. Compile-tested only.

Cc: Philipp Reisner <philipp.reisner@linbit.com>
Cc: Lars Ellenberg <lars.ellenberg@linbit.com>
Fixes: 7435e901 ("drbd: zero-out partial unaligned discards on local backend")
Signed-off-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 1f57f8d4
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1244,8 +1244,8 @@ drbd_request_prepare(struct drbd_device *device, struct bio *bio, unsigned long
	_drbd_start_io_acct(device, req);
	_drbd_start_io_acct(device, req);


	/* process discards always from our submitter thread */
	/* process discards always from our submitter thread */
	if ((bio_op(bio) & REQ_OP_WRITE_ZEROES) ||
	if (bio_op(bio) == REQ_OP_WRITE_ZEROES ||
	    (bio_op(bio) & REQ_OP_DISCARD))
	    bio_op(bio) == REQ_OP_DISCARD)
		goto queue_for_submitter_thread;
		goto queue_for_submitter_thread;


	if (rw == WRITE && req->private_bio && req->i.size
	if (rw == WRITE && req->private_bio && req->i.size