mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-09 00:02:02 +08:00
block: rate-limit capacity change info log
commit 3179a5f7f8 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
519ce47cd2
commit
126fd80cb1
+1
-1
@@ -88,7 +88,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);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user