summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@wdc.com>2018-06-25 15:51:30 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-24 13:09:09 +0200
commita567493430be60b2a29b37d6401992f68acce032 (patch)
tree57f9234ba6715d2b61aafe4b8045672694c04cda /drivers/block
parent8a9e8b683a7c8a3fb52fcaa692ffd704ba03f29d (diff)
downloadlinux-stable-a567493430be60b2a29b37d6401992f68acce032.tar.gz
linux-stable-a567493430be60b2a29b37d6401992f68acce032.tar.bz2
linux-stable-a567493430be60b2a29b37d6401992f68acce032.zip
drbd: Fix drbd_request_prepare() discard handling
[ Upstream commit fad2d4ef636654e926d374ef038f4cd4286661f6 ] 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: 7435e9018f91 ("drbd: zero-out partial unaligned discards on local backend") Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/drbd/drbd_req.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index de8566e55334..c72071c300bb 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -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