fs: fat: rate limit the kernel messages

If FAT formatted SD card gets removed without unmounting,
FAT file system may throw many kernel error messages which
could too much traffic for console driver and can sometimes
even cause the system to trigger watchdog timeout.

This patch converts the printk to printk_ratelimited to rate
limit the error messages from FAT fs.

Change-Id: I58b942f6714a8d3353478eb21139b8046ee3f875
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
(cherry picked from commit a872b71069d717ced1a2de642afa0693d1bb9448)
This commit is contained in:
Subhash Jadavani 2012-05-28 18:30:35 +05:30 committed by Stephen Boyd
parent 390bd8ddc9
commit f7ba1eb0da

View file

@ -56,7 +56,11 @@ void fat_msg(struct super_block *sb, const char *level, const char *fmt, ...)
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
printk("%sFAT-fs (%s): %pV\n", level, sb->s_id, &vaf);
if (!strncmp(level, KERN_ERR, sizeof(KERN_ERR)))
printk_ratelimited("%sFAT-fs (%s): %pV\n", level,
sb->s_id, &vaf);
else
printk("%sFAT-fs (%s): %pV\n", level, sb->s_id, &vaf);
va_end(args);
}