Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: rate-limit capacity change info log

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>

authored by

Li Chen and committed by
Jens Axboe
3179a5f7 ade260ca

+1 -1
+1 -1
block/genhd.c
··· 90 90 (disk->flags & GENHD_FL_HIDDEN)) 91 91 return false; 92 92 93 - pr_info("%s: detected capacity change from %lld to %lld\n", 93 + pr_info_ratelimited("%s: detected capacity change from %lld to %lld\n", 94 94 disk->disk_name, capacity, size); 95 95 96 96 /*