diff --git a/fs/ext4/super.c b/fs/ext4/super.c index f1a089ebe848a75e6565e58e15fcc59fe2517060..af518c71befbb59a8db1ade4895fa1b4ac3e9dba 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -6524,8 +6524,19 @@ static 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; }