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

fat: add ratelimit to fat*_ent_bread()

fat*_ent_bread() can be the cause of too many report on I/O error path.
So use fat_msg_ratelimit() instead.

Link: https://lkml.kernel.org/r/87bkxogfeq.fsf@mail.parknet.co.jp
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Reported-by: qianfan <qianfanguijin@163.com>
Tested-by: qianfan <qianfanguijin@163.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

OGAWA Hirofumi and committed by
akpm
183c3237 e057aaec

+4 -3
+4 -3
fs/fat/fatent.c
··· 94 94 err_brelse: 95 95 brelse(bhs[0]); 96 96 err: 97 - fat_msg(sb, KERN_ERR, "FAT read failed (blocknr %llu)", (llu)blocknr); 97 + fat_msg_ratelimit(sb, KERN_ERR, "FAT read failed (blocknr %llu)", 98 + (llu)blocknr); 98 99 return -EIO; 99 100 } 100 101 ··· 108 107 fatent->fat_inode = MSDOS_SB(sb)->fat_inode; 109 108 fatent->bhs[0] = sb_bread(sb, blocknr); 110 109 if (!fatent->bhs[0]) { 111 - fat_msg(sb, KERN_ERR, "FAT read failed (blocknr %llu)", 112 - (llu)blocknr); 110 + fat_msg_ratelimit(sb, KERN_ERR, "FAT read failed (blocknr %llu)", 111 + (llu)blocknr); 113 112 return -EIO; 114 113 } 115 114 fatent->nr_bhs = 1;