summaryrefslogtreecommitdiff
path: root/drivers/md/dm-stats.h
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2022-02-18 07:39:57 +0300
committerMike Snitzer <snitzer@redhat.com>2022-02-21 23:35:25 +0300
commit8d394bc4adf588ca4a0650745167cb83f86c18c9 (patch)
treeacf42f01698400207c0bdcbcdc6b2a5cd589fd98 /drivers/md/dm-stats.h
parent9f6dc633761006f974701d4c88da71ab68670749 (diff)
downloadlinux-8d394bc4adf588ca4a0650745167cb83f86c18c9.tar.xz
dm: fix double accounting of flush with data
DM handles a flush with data by first issuing an empty flush and then once it completes the REQ_PREFLUSH flag is removed and the payload is issued. The problem fixed by this commit is that both the empty flush bio and the data payload will account the full extent of the data payload. Fix this by factoring out dm_io_acct() and having it wrap all IO accounting to set the size of bio with REQ_PREFLUSH to 0, account the IO, and then restore the original size. Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-stats.h')
-rw-r--r--drivers/md/dm-stats.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-stats.h b/drivers/md/dm-stats.h
index 2ddfae678f32..09fa579e2e24 100644
--- a/drivers/md/dm-stats.h
+++ b/drivers/md/dm-stats.h
@@ -32,7 +32,7 @@ int dm_stats_message(struct mapped_device *md, unsigned argc, char **argv,
void dm_stats_account_io(struct dm_stats *stats, unsigned long bi_rw,
sector_t bi_sector, unsigned bi_sectors, bool end,
- unsigned long duration_jiffies,
+ unsigned long start_time,
struct dm_stats_aux *aux);
static inline bool dm_stats_used(struct dm_stats *st)