From: Jiufei Xue Date: Tue, 27 Feb 2018 12:10:03 +0000 (+0800) Subject: block: fix the count of PGPGOUT for WRITE_SAME X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=17644a0bbb190b6286106e98392f3d60ee020a23;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Christoph Hellwig Signed-off-by: Jiufei Xue Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- diff --git a/block/blk-core.c b/block/blk-core.c index 95b7ea996ac2..c01f4907dbbc 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -2277,7 +2277,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);