ext4: Fix deadlock with quota feature
Jan Kara
reviewerPATCH 1/1 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 <[email protected]>
--- fs/ext4/super.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
fs/ext4/super.c +2 -0
@@ -4945,6 +4945,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);
Signature · 1 line
1.7.1
Quoted 6 lines · Jan Kara
We didn't mark hidden quota files with
S_NOQUOTAflag 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 <[email protected]>
Thanks, applied.
- Ted