diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 8f9d60ec607ea364cd75ad79c2c14b5874133ad7..3100f4aa2d59510a5a8d017a27cc2864ce7ff986 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -6166,8 +6166,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; }