quota: Hide warnings about writes to the filesystem before quota was turned on

For a root filesystem write to the filesystem before quota is turned on happens
regularly and there's no way around it because of writes to syslog, /etc/mtab,
and similar. So the warning is rather pointless for ordinary users. It's
still useful during development so we just hide the warning behind
__DQUOT_PARANOIA config option.

Signed-off-by: Jan Kara <jack@suse.cz>

Jan Kara 4c5e6c0e 774f03fb

+6
+6
fs/quota/dquot.c
··· 874 static void add_dquot_ref(struct super_block *sb, int type) 875 { 876 struct inode *inode, *old_inode = NULL; 877 int reserved = 0; 878 879 spin_lock(&inode_lock); 880 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { 881 if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW)) 882 continue; 883 if (unlikely(inode_get_rsv_space(inode) > 0)) 884 reserved = 1; 885 if (!atomic_read(&inode->i_writecount)) 886 continue; 887 if (!dqinit_needed(inode, type)) ··· 907 spin_unlock(&inode_lock); 908 iput(old_inode); 909 910 if (reserved) { 911 printk(KERN_WARNING "VFS (%s): Writes happened before quota" 912 " was turned on thus quota information is probably " 913 "inconsistent. Please run quotacheck(8).\n", sb->s_id); 914 } 915 } 916 917 /*
··· 874 static void add_dquot_ref(struct super_block *sb, int type) 875 { 876 struct inode *inode, *old_inode = NULL; 877 + #ifdef __DQUOT_PARANOIA 878 int reserved = 0; 879 + #endif 880 881 spin_lock(&inode_lock); 882 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { 883 if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW)) 884 continue; 885 + #ifdef __DQUOT_PARANOIA 886 if (unlikely(inode_get_rsv_space(inode) > 0)) 887 reserved = 1; 888 + #endif 889 if (!atomic_read(&inode->i_writecount)) 890 continue; 891 if (!dqinit_needed(inode, type)) ··· 903 spin_unlock(&inode_lock); 904 iput(old_inode); 905 906 + #ifdef __DQUOT_PARANOIA 907 if (reserved) { 908 printk(KERN_WARNING "VFS (%s): Writes happened before quota" 909 " was turned on thus quota information is probably " 910 "inconsistent. Please run quotacheck(8).\n", sb->s_id); 911 } 912 + #endif 913 } 914 915 /*