summaryrefslogtreecommitdiffstats
path: root/fs/quota/quota_tree.h
diff options
context:
space:
mode:
authorJiaying Zhang <jiayingz@google.com>2010-05-17 18:36:03 +0200
committerJan Kara <jack@suse.cz>2010-05-21 19:30:49 +0200
commit1907131bbeabb33db313bad34f3ec1a5faedbd64 (patch)
treee5561fce158ea6f17406f8f17871af0c61d5cbd5 /fs/quota/quota_tree.h
parentocfs2: Fix lock inversion in quotas during umount (diff)
downloadlinux-1907131bbeabb33db313bad34f3ec1a5faedbd64.tar.xz
linux-1907131bbeabb33db313bad34f3ec1a5faedbd64.zip
dquot: Detect partial write error to quota file in write_blk() and add printk_ratelimit for quota error messages
This patch changes quota_tree.c:write_blk() to detect error caused by partial write to quota file and add a macro to limit control printed quota error messages so we won't fill up dmesg with a corrupted quota file. Signed-off-by: Jiaying Zhang <jiayingz@google.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/quota/quota_tree.h')
-rw-r--r--fs/quota/quota_tree.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/quota/quota_tree.h b/fs/quota/quota_tree.h
index a1ab8db81a51..ccc3e71fb1d8 100644
--- a/fs/quota/quota_tree.h
+++ b/fs/quota/quota_tree.h
@@ -22,4 +22,10 @@ struct qt_disk_dqdbheader {
#define QT_TREEOFF 1 /* Offset of tree in file in blocks */
+#define q_warn(fmt, args...) \
+do { \
+ if (printk_ratelimit()) \
+ printk(fmt, ## args); \
+} while(0)
+
#endif /* _LINUX_QUOTAIO_TREE_H */