summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiufei Xue <jiufei.xue@linux.alibaba.com>2018-02-27 20:10:03 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-08 22:47:31 -0800
commit8882f981b717b2e02e8424b1c8de19819d8eb42b (patch)
treef25038e4294c0e885f4827c0f3087431ee01d075
parente4c2c02c50b34b3984d13c7c868bc3d647af3dbf (diff)
downloadlinux-stable-8882f981b717b2e02e8424b1c8de19819d8eb42b.tar.gz
linux-stable-8882f981b717b2e02e8424b1c8de19819d8eb42b.tar.bz2
linux-stable-8882f981b717b2e02e8424b1c8de19819d8eb42b.zip
block: fix the count of PGPGOUT for WRITE_SAME
commit 7c5a0dcf557c6511a61e092ba887de28882fe857 upstream. The vm counters is counted in sectors, so we should do the conversation in submit_bio. Fixes: 74d46992e0d9 ("block: replace bi_bdev with a gendisk pointer and partitions index") Cc: stable@vger.kernel.org Reviewed-by: Omar Sandoval <osandov@fb.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jiufei Xue <jiufei.xue@linux.alibaba.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--block/blk-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 82b92adf3477..b725d9e340c2 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2401,7 +2401,7 @@ blk_qc_t submit_bio(struct bio *bio)
unsigned int count;
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
count = bio_sectors(bio);