Commit e294a537 authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: ratelimit the file system mounted message

The xfstests ext4/305 will mount and unmount the same file system over
4,000 times, and each one of these will cause a system log message.
Ratelimit this message since if we are getting more than a few dozen
of these messages, they probably aren't going to be helpful.
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent da0b5e40
...@@ -60,6 +60,7 @@ static struct ext4_lazy_init *ext4_li_info; ...@@ -60,6 +60,7 @@ static struct ext4_lazy_init *ext4_li_info;
static struct mutex ext4_li_mtx; static struct mutex ext4_li_mtx;
static struct ext4_features *ext4_feat; static struct ext4_features *ext4_feat;
static int ext4_mballoc_ready; static int ext4_mballoc_ready;
static struct ratelimit_state ext4_mount_msg_ratelimit;
static int ext4_load_journal(struct super_block *, struct ext4_super_block *, static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
unsigned long journal_devnum); unsigned long journal_devnum);
...@@ -4277,9 +4278,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -4277,9 +4278,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
"the device does not support discard"); "the device does not support discard");
} }
ext4_msg(sb, KERN_INFO, "mounted filesystem with%s. " if (___ratelimit(&ext4_mount_msg_ratelimit, "EXT4-fs mount"))
"Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, ext4_msg(sb, KERN_INFO, "mounted filesystem with%s. "
*sbi->s_es->s_mount_opts ? "; " : "", orig_data); "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts,
*sbi->s_es->s_mount_opts ? "; " : "", orig_data);
if (es->s_error_count) if (es->s_error_count)
mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */
...@@ -5617,6 +5619,7 @@ static int __init ext4_init_fs(void) ...@@ -5617,6 +5619,7 @@ static int __init ext4_init_fs(void)
{ {
int i, err; int i, err;
ratelimit_state_init(&ext4_mount_msg_ratelimit, 30 * HZ, 64);
ext4_li_info = NULL; ext4_li_info = NULL;
mutex_init(&ext4_li_mtx); mutex_init(&ext4_li_mtx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment