===================================================================
@@ -501,13 +501,13 @@ static void end_io_acct(struct mapped_de
{
unsigned long duration = jiffies - start_time;
- bio_end_io_acct(bio, start_time);
-
if (unlikely(dm_stats_used(&md->stats)))
dm_stats_account_io(&md->stats, bio_data_dir(bio),
bio->bi_iter.bi_sector, bio_sectors(bio),
true, duration, stats_aux);
+ bio_end_io_acct(bio, start_time);
+
/* nudge anyone waiting on suspend queue */
if (unlikely(wq_has_sleeper(&md->wait)))
wake_up(&md->wait);
When bio_end_io_acct ends, the count of in-progress I/Os may reach zero and the device may be suspended. There is a possibility that the suspend races with dm_stats_account_io. We need to call dm_stats_account_io before bio_end_io_acct. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org --- drivers/md/dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel