diff options
author | Theodore Ts'o <tytso@mit.edu> | 2013-10-17 21:11:01 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-10-17 21:11:01 -0400 |
commit | efbed4dc5857f845d787e406ce85097d1ccc5c4f (patch) | |
tree | 4cfd6a4c20e52b21c3f26632c849dd084df6f632 /fs/ext4/ext4.h | |
parent | aeac589a74b91c4c07458272767e089810fbd23d (diff) | |
download | linux-next-efbed4dc5857f845d787e406ce85097d1ccc5c4f.tar.gz |
ext4: add ratelimiting to ext4 messages
In the case of a storage device that suddenly disappears, or in the
case of significant file system corruption, this can result in a huge
flood of messages being sent to the console. This can overflow the
file system containing /var/log/messages, or if a serial console is
configured, this can slow down the system so much that a hardware
watchdog can end up triggering forcing a system reboot.
Google-Bug-Id: 7258357
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index af815ea9d7cc..65485ab7a889 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -29,6 +29,7 @@ #include <linux/wait.h> #include <linux/blockgroup_lock.h> #include <linux/percpu_counter.h> +#include <linux/ratelimit.h> #include <crypto/hash.h> #ifdef __KERNEL__ #include <linux/compat.h> @@ -1314,6 +1315,11 @@ struct ext4_sb_info { unsigned long s_es_last_sorted; struct percpu_counter s_extent_cache_cnt; spinlock_t s_es_lru_lock ____cacheline_aligned_in_smp; + + /* Ratelimit ext4 messages. */ + struct ratelimit_state s_err_ratelimit_state; + struct ratelimit_state s_warning_ratelimit_state; + struct ratelimit_state s_msg_ratelimit_state; }; static inline struct ext4_sb_info *EXT4_SB(struct super_block *sb) |