diff options
| author | Li Chen <chenl311@chinatelecom.cn> | 2025-11-17 08:34:07 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-01-08 12:14:14 +0300 |
| commit | 0a65cac1d86eec645aca644833398e7ac72ebfda (patch) | |
| tree | 9ae204eae0f6f85bc1b69dc14aa86dcb039ff34b /block | |
| parent | e768e889561e1e9d9aa4fc2119d0ce5d7877fd43 (diff) | |
| download | linux-0a65cac1d86eec645aca644833398e7ac72ebfda.tar.xz | |
block: rate-limit capacity change info log
commit 3179a5f7f86bcc3acd5d6fb2a29f891ef5615852 upstream.
loop devices under heavy stress-ng loop streessor can trigger many
capacity change events in a short time. Each event prints an info
message from set_capacity_and_notify(), flooding the console and
contributing to soft lockups on slow consoles.
Switch the printk in set_capacity_and_notify() to
pr_info_ratelimited() so frequent capacity changes do not spam
the log while still reporting occasional changes.
Cc: stable@vger.kernel.org
Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block')
| -rw-r--r-- | block/genhd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/genhd.c b/block/genhd.c index 99344f53c789..22fea4eb4241 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -83,7 +83,7 @@ bool set_capacity_and_notify(struct gendisk *disk, sector_t size) (disk->flags & GENHD_FL_HIDDEN)) return false; - pr_info("%s: detected capacity change from %lld to %lld\n", + pr_info_ratelimited("%s: detected capacity change from %lld to %lld\n", disk->disk_name, capacity, size); /* |
