Commit 4c5e6c0e authored by Jan Kara's avatar Jan Kara

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: default avatarJan Kara <jack@suse.cz>
parent 774f03fb
...@@ -874,14 +874,18 @@ static int dqinit_needed(struct inode *inode, int type) ...@@ -874,14 +874,18 @@ static int dqinit_needed(struct inode *inode, int type)
static void add_dquot_ref(struct super_block *sb, int type) static void add_dquot_ref(struct super_block *sb, int type)
{ {
struct inode *inode, *old_inode = NULL; struct inode *inode, *old_inode = NULL;
#ifdef __DQUOT_PARANOIA
int reserved = 0; int reserved = 0;
#endif
spin_lock(&inode_lock); spin_lock(&inode_lock);
list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW)) if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW))
continue; continue;
#ifdef __DQUOT_PARANOIA
if (unlikely(inode_get_rsv_space(inode) > 0)) if (unlikely(inode_get_rsv_space(inode) > 0))
reserved = 1; reserved = 1;
#endif
if (!atomic_read(&inode->i_writecount)) if (!atomic_read(&inode->i_writecount))
continue; continue;
if (!dqinit_needed(inode, type)) if (!dqinit_needed(inode, type))
...@@ -903,11 +907,13 @@ static void add_dquot_ref(struct super_block *sb, int type) ...@@ -903,11 +907,13 @@ static void add_dquot_ref(struct super_block *sb, int type)
spin_unlock(&inode_lock); spin_unlock(&inode_lock);
iput(old_inode); iput(old_inode);
#ifdef __DQUOT_PARANOIA
if (reserved) { if (reserved) {
printk(KERN_WARNING "VFS (%s): Writes happened before quota" printk(KERN_WARNING "VFS (%s): Writes happened before quota"
" was turned on thus quota information is probably " " was turned on thus quota information is probably "
"inconsistent. Please run quotacheck(8).\n", sb->s_id); "inconsistent. Please run quotacheck(8).\n", sb->s_id);
} }
#endif
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment