From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Jens Axboe <axboe@fb.com>
Cc: Jan Kara <jack@suse.cz>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Mike Snitzer <snitzer@redhat.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
device-mapper development <dm-devel@redhat.com>,
Dmitry Monakhov <dmonakhov@openvz.org>,
Christoph Hellwig <hch@lst.de>
Subject: [PATCH 6/6] brd: Accept non-aligned discard requests with size zero
Date: Thu, 17 Dec 2015 12:43:12 +0100 [thread overview]
Message-ID: <56729FD0.3070309@sandisk.com> (raw)
In-Reply-To: <56729ECF.50906@sandisk.com>
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Dmitry Monakhov <dmonakhov@openvz.org>
---
drivers/block/brd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 7e0a54e..a757c7b 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -339,8 +339,9 @@ static blk_qc_t brd_make_request(struct request_queue *q, struct bio *bio)
blk_queue_split(q, &bio, q->bio_split);
if (unlikely(bio->bi_rw & REQ_DISCARD)) {
- if (sector & ((PAGE_SIZE >> SECTOR_SHIFT) - 1) ||
- bio->bi_iter.bi_size & ~PAGE_MASK)
+ if (bio->bi_iter.bi_size &&
+ (sector & ((PAGE_SIZE >> SECTOR_SHIFT) - 1) ||
+ bio->bi_iter.bi_size & ~PAGE_MASK))
goto io_error;
discard_from_brd(brd, sector, bio->bi_iter.bi_size);
goto out;
--
2.1.4
prev parent reply other threads:[~2015-12-17 11:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 11:38 [PATCH v2 0/6] Make blkdev_issue_discard() submit aligned discard requests Bart Van Assche
2015-12-17 11:39 ` [PATCH 1/6] block: Introduce blk_round_sect_down() Bart Van Assche
2015-12-18 12:30 ` Christoph Hellwig
2015-12-17 11:40 ` [PATCH 2/6] block: Introduce bio_add_zero_pages() Bart Van Assche
2015-12-18 12:30 ` Christoph Hellwig
2015-12-17 11:41 ` [PATCH 3/6] block: Optimize __blkdev_issue_zeroout() Bart Van Assche
2015-12-17 14:18 ` Bart Van Assche
2015-12-17 11:41 ` [PATCH 4/6] block: Make blkdev_issue_discard() submit aligned discard requests Bart Van Assche
2015-12-17 11:42 ` [PATCH 5/6] brd: Split bio if needed Bart Van Assche
2015-12-17 11:43 ` Bart Van Assche [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56729FD0.3070309@sandisk.com \
--to=bart.vanassche@sandisk.com \
--cc=axboe@fb.com \
--cc=dm-devel@redhat.com \
--cc=dmonakhov@openvz.org \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=linux-block@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=snitzer@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.