From: Jan Kara Date: Tue, 25 Jul 2023 14:45:06 +0000 (+0200) Subject: quota: Check presence of quota operation structures instead of ->quota_read and ... X-Git-Tag: v6.6-rc1~219^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=86be6b8bd834bece87e6adc5313cb41e1ba7fe81;p=thirdparty%2Fkernel%2Flinux.git quota: Check presence of quota operation structures instead of ->quota_read and ->quota_write callbacks 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 Reviewed-by: Carlos Maiolino Message-Id: <20230725144510.253763-4-cem@kernel.org> Signed-off-by: Christian Brauner --- diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index e3e4f40476579..4d826c369da26 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -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;