diff mbox series

[v2] block: ratelimit handle_bad_sector() message

Message ID 20201008133723.5311-1-penguin-kernel@I-love.SAKURA.ne.jp (mailing list archive)
State New, archived
Headers show
Series [v2] block: ratelimit handle_bad_sector() message | expand

Commit Message

Tetsuo Handa Oct. 8, 2020, 1:37 p.m. UTC
syzbot is reporting unkillable task [1], for the caller is failing to
handle a corrupted filesystem image which attempts to access beyond
the end of the device. While we need to fix the caller, flooding the
console with handle_bad_sector() message is unlikely useful.

[1] https://syzkaller.appspot.com/bug?id=f1f49fb971d7a3e01bd8ab8cff2ff4572ccf3092

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
 block/blk-core.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Christoph Hellwig Oct. 8, 2020, 1:52 p.m. UTC | #1
Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Jens Axboe Oct. 8, 2020, 4:17 p.m. UTC | #2
On 10/8/20 7:37 AM, Tetsuo Handa wrote:
> syzbot is reporting unkillable task [1], for the caller is failing to
> handle a corrupted filesystem image which attempts to access beyond
> the end of the device. While we need to fix the caller, flooding the
> console with handle_bad_sector() message is unlikely useful.

Applied, thanks.
diff mbox series

Patch

diff --git a/block/blk-core.c b/block/blk-core.c
index 10c08ac50697..0014e7caae3d 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -803,11 +803,10 @@  static void handle_bad_sector(struct bio *bio, sector_t maxsector)
 {
 	char b[BDEVNAME_SIZE];
 
-	printk(KERN_INFO "attempt to access beyond end of device\n");
-	printk(KERN_INFO "%s: rw=%d, want=%Lu, limit=%Lu\n",
-			bio_devname(bio, b), bio->bi_opf,
-			(unsigned long long)bio_end_sector(bio),
-			(long long)maxsector);
+	pr_info_ratelimited("attempt to access beyond end of device\n"
+			    "%s: rw=%d, want=%llu, limit=%llu\n",
+			    bio_devname(bio, b), bio->bi_opf,
+			    bio_end_sector(bio), maxsector);
 }
 
 #ifdef CONFIG_FAIL_MAKE_REQUEST