Skip to content

Commit f794300

Browse files
FirstLoveLifekawasaki
authored andcommitted
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: [email protected] Signed-off-by: Li Chen <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]>
1 parent 6f43942 commit f794300

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/genhd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ bool set_capacity_and_notify(struct gendisk *disk, sector_t size)
9090
(disk->flags & GENHD_FL_HIDDEN))
9191
return false;
9292

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",
9494
disk->disk_name, capacity, size);
9595

9696
/*

0 commit comments

Comments
 (0)