md/md-faulty: enable io accounting
authorYu Kuai <yukuai3@huawei.com>
Wed, 21 Jun 2023 16:51:10 +0000 (00:51 +0800)
committerSong Liu <song@kernel.org>
Thu, 27 Jul 2023 07:13:30 +0000 (00:13 -0700)
use md_account_bio() to enable io accounting, also make sure
mddev_suspend() will wait for all io to be done.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230621165110.1498313-9-yukuai1@huaweicloud.com
drivers/md/md-faulty.c

index 50ad818978a4333bc225cd3626c3265ded5167d0..a039e8e20f55a3cf87d870cebee9787e8b98fef2 100644 (file)
@@ -204,6 +204,8 @@ static bool faulty_make_request(struct mddev *mddev, struct bio *bio)
                        failit = 1;
                }
        }
+
+       md_account_bio(mddev, &bio);
        if (failit) {
                struct bio *b = bio_alloc_clone(conf->rdev->bdev, bio, GFP_NOIO,
                                                &mddev->bio_set);