block: nr_phys_segments needs to be zero for REQ_OP_WRITE_ZEROES
diff mbox series

Message ID 20190703122435.18255-1-hch@lst.de
State New
Headers show
Series
  • block: nr_phys_segments needs to be zero for REQ_OP_WRITE_ZEROES
Related show

Commit Message

Christoph Hellwig July 3, 2019, 12:24 p.m. UTC
Fix a regression introduced when removing bi_phys_segments for Write Zeroes
requests, which need to have a segment count of zero, as they don't have a
payload.

Fixes: 14ccb66b3f58 ("block: remove the bi_phys_segments field in struct bio")
Reported-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-merge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jens Axboe July 3, 2019, 1:30 p.m. UTC | #1
On 7/3/19 6:24 AM, Christoph Hellwig wrote:
> Fix a regression introduced when removing bi_phys_segments for Write Zeroes
> requests, which need to have a segment count of zero, as they don't have a
> payload.

Fixes it for me, thanks. Applied.

Patch
diff mbox series

diff --git a/block/blk-merge.c b/block/blk-merge.c
index ca45eb51c669..57f7990b342d 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -105,7 +105,7 @@  static struct bio *blk_bio_discard_split(struct request_queue *q,
 static struct bio *blk_bio_write_zeroes_split(struct request_queue *q,
 		struct bio *bio, struct bio_set *bs, unsigned *nsegs)
 {
-	*nsegs = 1;
+	*nsegs = 0;
 
 	if (!q->limits.max_write_zeroes_sectors)
 		return NULL;