浏览代码

ext4: fix deadlock with quota feature

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>
Jan Kara 12 年之前
父节点
当前提交
bcb1385096
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fs/ext4/super.c

+ 2 - 0
fs/ext4/super.c

@@ -4953,6 +4953,8 @@ static int ext4_quota_enable(struct super_block *sb, int type, int format_id,
 		return PTR_ERR(qf_inode);
 		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);
 	err = dquot_enable(qf_inode, type, format_id, flags);
 	iput(qf_inode);
 	iput(qf_inode);