]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/quota/dquot.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[net-next-2.6.git] / fs / quota / dquot.c
index eb938015bd91a1983513c1c2a297a66467605dd8..2ca967a5ef77de2011d9896695bf80ad4f0e155b 100644 (file)
@@ -823,12 +823,12 @@ static void add_dquot_ref(struct super_block *sb, int type)
 
        spin_lock(&inode_lock);
        list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
+               if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
+                       continue;
                if (!atomic_read(&inode->i_writecount))
                        continue;
                if (!dqinit_needed(inode, type))
                        continue;
-               if (inode->i_state & (I_FREEING|I_WILL_FREE))
-                       continue;
 
                __iget(inode);
                spin_unlock(&inode_lock);
@@ -915,6 +915,12 @@ static void remove_dquot_ref(struct super_block *sb, int type,
 
        spin_lock(&inode_lock);
        list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
+               /*
+                *  We have to scan also I_NEW inodes because they can already
+                *  have quota pointer initialized. Luckily, we need to touch
+                *  only quota pointers and these have separate locking
+                *  (dqptr_sem).
+                */
                if (!IS_NOQUOTA(inode))
                        remove_inode_dquot_ref(inode, type, tofree_head);
        }