Skip to contentSkip to conversation

drbd: Fix drbd_request_prepare() discard handling

PATCH Applied Bart Van Assche 3 participants 3 messages Jun 25, 2018 – Jun 29, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Fixes 7435e9018f91 ("drbd: zero-out partial unaligned discards on local backend")
Cc Philipp Reisner <[email protected]>
Cc Lars Ellenberg <[email protected]>
---
 drivers/block/drbd/drbd_req.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/drbd/drbd_req.c +2 -2
index 24f0884ec01f..a8e7d7318e37 100644
@@ -1244,8 +1244,8 @@ drbd_request_prepare(struct drbd_device *device, struct bio *bio, unsigned long
 	_drbd_start_io_acct(device, req);
 
 	/* process discards always from our submitter thread */
-	if ((bio_op(bio) & REQ_OP_WRITE_ZEROES) ||
-	    (bio_op(bio) & REQ_OP_DISCARD))
+	if (bio_op(bio) == REQ_OP_WRITE_ZEROES ||
+	    bio_op(bio) == REQ_OP_DISCARD)
 		goto queue_for_submitter_thread;
 
 	if (rw == WRITE && req->private_bio && req->i.size
Signature · 1 line
2.17.1
maintainer Applied
#2 lore raw
In reply to Bart Van Assche
Quoted 2 lines · Bart Van Assche

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

Applied, thanks Bart.

Signature · 1 line
Jens Axboe