aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dquot.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dquot.c')
-rw-r--r--fs/dquot.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/dquot.c b/fs/dquot.c
index bca3cac4bee7..cb1c3bc324de 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -789,12 +789,12 @@ static void add_dquot_ref(struct super_block *sb, int type)
789 789
790 spin_lock(&inode_lock); 790 spin_lock(&inode_lock);
791 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { 791 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
792 if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
793 continue;
792 if (!atomic_read(&inode->i_writecount)) 794 if (!atomic_read(&inode->i_writecount))
793 continue; 795 continue;
794 if (!dqinit_needed(inode, type)) 796 if (!dqinit_needed(inode, type))
795 continue; 797 continue;
796 if (inode->i_state & (I_FREEING|I_WILL_FREE))
797 continue;
798 798
799 __iget(inode); 799 __iget(inode);
800 spin_unlock(&inode_lock); 800 spin_unlock(&inode_lock);
@@ -870,6 +870,12 @@ static void remove_dquot_ref(struct super_block *sb, int type,
870 870
871 spin_lock(&inode_lock); 871 spin_lock(&inode_lock);
872 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { 872 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
873 /*
874 * We have to scan also I_NEW inodes because they can already
875 * have quota pointer initialized. Luckily, we need to touch
876 * only quota pointers and these have separate locking
877 * (dqptr_sem).
878 */
873 if (!IS_NOQUOTA(inode)) 879 if (!IS_NOQUOTA(inode))
874 remove_inode_dquot_ref(inode, type, tofree_head); 880 remove_inode_dquot_ref(inode, type, tofree_head);
875 } 881 }