1
0
Fork 0

block: nr_phys_segments needs to be zero for REQ_OP_WRITE_ZEROES

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: 14ccb66b3f ("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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
alistair/sunxi64-5.4-dsi
Christoph Hellwig 2019-07-03 05:24:35 -07:00 committed by Jens Axboe
parent 970d168de6
commit d665e12aa7
1 changed files with 1 additions and 1 deletions

View File

@ -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;