Skip to content

Commit

Permalink
block: nr_phys_segments needs to be zero for REQ_OP_WRITE_ZEROES
Browse files Browse the repository at this point in the history
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: 14ccb66 ("block: remove the bi_phys_segments field in struct bio")
Reported-by: Jens Axboe <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Jul 3, 2019
1 parent 970d168 commit d665e12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d665e12

Please sign in to comment.