]> git.itanic.dy.fi Git - linux-stable/commitdiff
quota: Check presence of quota operation structures instead of ->quota_read and ...
authorJan Kara <jack@suse.cz>
Tue, 25 Jul 2023 14:45:06 +0000 (16:45 +0200)
committerChristian Brauner <brauner@kernel.org>
Wed, 9 Aug 2023 07:15:39 +0000 (09:15 +0200)
Currently we check whether superblock has ->quota_read and ->quota_write
operations to check whether filesystem supports quotas. However for
example for shmfs we will not read or write dquots so check whether
quota operations are set in the superblock instead.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Message-Id: <20230725144510.253763-4-cem@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/quota/dquot.c

index e3e4f40476579cd903b5db37ce26b3984410dea9..4d826c369da268e0bbcc46e78d1662f30a6d2529 100644 (file)
@@ -2367,7 +2367,7 @@ int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,
 
        if (!fmt)
                return -ESRCH;
-       if (!sb->s_op->quota_write || !sb->s_op->quota_read ||
+       if (!sb->dq_op || !sb->s_qcop ||
            (type == PRJQUOTA && sb->dq_op->get_projid == NULL)) {
                error = -EINVAL;
                goto out_fmt;