Commit 4c5e6c0e70fd6ca2fa67184fd36a261b3b7b38d0
1 parent
774f03fb2c
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 6 additions and 0 deletions Side-by-side Diff
fs/quota/dquot.c
... | ... | @@ -874,14 +874,18 @@ |
874 | 874 | static void add_dquot_ref(struct super_block *sb, int type) |
875 | 875 | { |
876 | 876 | struct inode *inode, *old_inode = NULL; |
877 | +#ifdef __DQUOT_PARANOIA | |
877 | 878 | int reserved = 0; |
879 | +#endif | |
878 | 880 | |
879 | 881 | spin_lock(&inode_lock); |
880 | 882 | list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { |
881 | 883 | if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW)) |
882 | 884 | continue; |
885 | +#ifdef __DQUOT_PARANOIA | |
883 | 886 | if (unlikely(inode_get_rsv_space(inode) > 0)) |
884 | 887 | reserved = 1; |
888 | +#endif | |
885 | 889 | if (!atomic_read(&inode->i_writecount)) |
886 | 890 | continue; |
887 | 891 | if (!dqinit_needed(inode, type)) |
888 | 892 | |
... | ... | @@ -903,11 +907,13 @@ |
903 | 907 | spin_unlock(&inode_lock); |
904 | 908 | iput(old_inode); |
905 | 909 | |
910 | +#ifdef __DQUOT_PARANOIA | |
906 | 911 | if (reserved) { |
907 | 912 | printk(KERN_WARNING "VFS (%s): Writes happened before quota" |
908 | 913 | " was turned on thus quota information is probably " |
909 | 914 | "inconsistent. Please run quotacheck(8).\n", sb->s_id); |
910 | 915 | } |
916 | +#endif | |
911 | 917 | } |
912 | 918 | |
913 | 919 | /* |