diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 863a3eae505a3e245c9c828eb9defbca48ba6869..1b55f234e0064e5ffbcaea1befb8aa34c471f71f 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -6837,8 +6837,19 @@ int ext4_enable_quotas(struct super_block *sb) "Failed to enable quota tracking " "(type=%d, err=%d). Please run " "e2fsck to fix.", type, err); - for (type--; type >= 0; type--) + for (type--; type >= 0; type--) { + struct inode *inode; + + inode = sb_dqopt(sb)->files[type]; + if (inode) + inode = igrab(inode); dquot_quota_off(sb, type); + if (inode) { + lockdep_set_quota_inode(inode, + I_DATA_SEM_NORMAL); + iput(inode); + } + } return err; }