diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 4aae7e3e89a12..2603537b1f66b 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5856,6 +5856,11 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, /* Quotafile not on the same filesystem? */ if (path->dentry->d_sb != sb) return -EXDEV; + + /* Quota already enabled for this file? */ + if (IS_NOQUOTA(d_inode(path->dentry))) + return -EBUSY; + /* Journaling quota? */ if (EXT4_SB(sb)->s_qf_names[type]) { /* Quotafile not in fs root? */