Skip to contentSkip to conversation

ext4: Fix deadlock with quota feature

PATCH Applied Jan Kara 2 participants 2 messages Apr 5, 2013 – Apr 9, 2013 ext4 file system

lore
Share & tools
lore

Jan Kara

author reviewer
#0 lore raw

PATCH 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.

---
 fs/ext4/super.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/ext4/super.c +2 -0
index 5d6d535..fc203b3 100644
@@ -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
maintainer Applied
#1 lore raw
Quoted 6 lines · Jan Kara

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.

Thanks, applied.

- Ted