diff options
author | Li Nan <linan122@huawei.com> | 2024-05-07 10:31:03 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-05-07 07:34:08 -0600 |
commit | 504fbcffea649cad69111e7597081dd8adc3b395 (patch) | |
tree | 851214c14a43795216c583b3bb527b8f4dd25ebd /drivers/md/md.h | |
parent | 719c15a75ebf3bda3ca718fe8e0ce63d262ec7ae (diff) | |
download | linux-stable-504fbcffea649cad69111e7597081dd8adc3b395.tar.gz linux-stable-504fbcffea649cad69111e7597081dd8adc3b395.tar.bz2 linux-stable-504fbcffea649cad69111e7597081dd8adc3b395.zip |
md: Revert "md: Fix overflow in is_mddev_idle"
This reverts commit 3f9f231236ce7e48780d8a4f1f8cb9fae2df1e4e.
Using 64bit for 'sync_io' is unnecessary from the gendisk side. This
overflow will not cause any functional impact, except for a UBSAN
warning. Solving this overflow requires introducing additional
calculations and checks which are not necessary. So just keep using
32bit for 'sync_io'.
Signed-off-by: Li Nan <linan122@huawei.com>
Link: https://lore.kernel.org/r/20240507023103.781816-1-linan666@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index 029dd0491a36..ca085ecad504 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -51,7 +51,7 @@ struct md_rdev { sector_t sectors; /* Device size (in 512bytes sectors) */ struct mddev *mddev; /* RAID array if running */ - long long last_events; /* IO event timestamp */ + int last_events; /* IO event timestamp */ /* * If meta_bdev is non-NULL, it means that a separate device is @@ -622,7 +622,7 @@ extern void mddev_unlock(struct mddev *mddev); static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors) { if (blk_queue_io_stat(bdev->bd_disk->queue)) - atomic64_add(nr_sectors, &bdev->bd_disk->sync_io); + atomic_add(nr_sectors, &bdev->bd_disk->sync_io); } static inline void md_sync_acct_bio(struct bio *bio, unsigned long nr_sectors) |