]> Pileus Git - ~andy/linux/commitdiff
ext4: fix deadlock with quota feature
authorJan Kara <jack@suse.cz>
Tue, 9 Apr 2013 13:21:41 +0000 (09:21 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 9 Apr 2013 13:21:41 +0000 (09:21 -0400)
We didn't mark hidden quota files with S_NOQUOTA flag and thus quota was
accounted even for quota files. Thus we could recurse back to quota code
when adding new blocks to quota file which can easily deadlock. Mark
hidden quota files properly.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/super.c

index 525beb6e3e1e81604f22399cf7818a7dc6b79d50..968ca93691751781931e4a1959eb51db06fb0c02 100644 (file)
@@ -4953,6 +4953,8 @@ static int ext4_quota_enable(struct super_block *sb, int type, int format_id,
                return PTR_ERR(qf_inode);
        }
 
+       /* Don't account quota for quota files to avoid recursion */
+       qf_inode->i_flags |= S_NOQUOTA;
        err = dquot_enable(qf_inode, type, format_id, flags);
        iput(qf_inode);