Skip to content

Commit 4c5e6c0

Browse files
committed
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>
1 parent 774f03f commit 4c5e6c0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/quota/dquot.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,14 +874,18 @@ static int dqinit_needed(struct inode *inode, int type)
874874
static void add_dquot_ref(struct super_block *sb, int type)
875875
{
876876
struct inode *inode, *old_inode = NULL;
877+
#ifdef __DQUOT_PARANOIA
877878
int reserved = 0;
879+
#endif
878880

879881
spin_lock(&inode_lock);
880882
list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
881883
if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW))
882884
continue;
885+
#ifdef __DQUOT_PARANOIA
883886
if (unlikely(inode_get_rsv_space(inode) > 0))
884887
reserved = 1;
888+
#endif
885889
if (!atomic_read(&inode->i_writecount))
886890
continue;
887891
if (!dqinit_needed(inode, type))
@@ -903,11 +907,13 @@ static void add_dquot_ref(struct super_block *sb, int type)
903907
spin_unlock(&inode_lock);
904908
iput(old_inode);
905909

910+
#ifdef __DQUOT_PARANOIA
906911
if (reserved) {
907912
printk(KERN_WARNING "VFS (%s): Writes happened before quota"
908913
" was turned on thus quota information is probably "
909914
"inconsistent. Please run quotacheck(8).\n", sb->s_id);
910915
}
916+
#endif
911917
}
912918

913919
/*

0 commit comments

Comments
 (0)