Commit 17644a0b authored by Jiufei Xue's avatar Jiufei Xue Committed by Greg Kroah-Hartman

block: fix the count of PGPGOUT for WRITE_SAME

commit 7c5a0dcf upstream.

The vm counters is counted in sectors, so we should do the conversation
in submit_bio.

Fixes: 74d46992 ("block: replace bi_bdev with a gendisk pointer and partitions index")
Reviewed-by: default avatarOmar Sandoval <>
Reviewed-by: default avatarChristoph Hellwig <>
Signed-off-by: default avatarJiufei Xue <>
Signed-off-by: default avatarJens Axboe <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent eae6179f
...@@ -2277,7 +2277,7 @@ blk_qc_t submit_bio(struct bio *bio) ...@@ -2277,7 +2277,7 @@ blk_qc_t submit_bio(struct bio *bio)
unsigned int count; unsigned int count;
if (unlikely(bio_op(bio) == REQ_OP_WRITE_SAME)) if (unlikely(bio_op(bio) == REQ_OP_WRITE_SAME))
count = queue_logical_block_size(bio->bi_disk->queue); count = queue_logical_block_size(bio->bi_disk->queue) >> 9;
else else
count = bio_sectors(bio); count = bio_sectors(bio);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment