block: ratelimit handle_bad_sector() message

[ Upstream commit f4ac712e4fe009635344b9af5d890fe25fcc8c0d ]

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Git-commit: b3a0ed411008c921cc009e5d613f92d6e09bd269
Git-repo: https://android.googlesource.com/kernel/common/
Change-Id: I7ea4c8794a0ad7baeb093b468ba0a49ecfef38af
Signed-off-by: Saranya R <quic_sarar@quicinc.com>
This commit is contained in:
Tetsuo Handa 2020-10-08 22:37:23 +09:00 committed by Saranya R
parent 9dfd0a5148
commit 22a5b9ed3b

View file

@ -2133,11 +2133,11 @@ 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=%Lu, limit=%Lu\n",
bio_devname(bio, b), bio->bi_opf,
(unsigned long long)bio_end_sector(bio),
(long long)maxsector);
}
#ifdef CONFIG_FAIL_MAKE_REQUEST