
hulk inclusion category: bugfix bugzilla: 188421, https://gitee.com/openeuler/kernel/issues/I7WMMI CVE: NA -------------------------------- 'ios' and 'sectors' is counted in bio_start_io_acct() while io is started insted of io is done. Hence switch to precise io accounting to count them when io is done. Signed-off-by: Li Nan <linan122@huawei.com> --- drivers/md/dm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 0aa6fd33abf1..6e79b125fce3 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -621,7 +621,7 @@ static void start_io_acct(struct dm_io *io) io->start_time = jiffies; - generic_start_io_acct(md->queue, bio_op(bio), bio_sectors(bio), + generic_start_precise_io_acct(md->queue, bio_op(bio), bio_sectors(bio), &dm_disk(md)->part0); atomic_set(&dm_disk(md)->part0.in_flight[rw], @@ -640,8 +640,8 @@ static void end_io_acct(struct mapped_device *md, struct bio *bio, int pending; int rw = bio_data_dir(bio); - generic_end_io_acct(md->queue, bio_op(bio), &dm_disk(md)->part0, - start_time); + generic_end_precise_io_acct(md->queue, bio_op(bio), &dm_disk(md)->part0, + start_time, bio_sectors(bio)); if (unlikely(dm_stats_used(&md->stats))) dm_stats_account_io(&md->stats, bio_data_dir(bio), -- 2.39.2