From patchwork Mon Jul 17 11:52:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Maiolino X-Patchwork-Id: 13315515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94617C001DC for ; Mon, 17 Jul 2023 11:53:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2CC316B0072; Mon, 17 Jul 2023 07:53:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 27C816B0078; Mon, 17 Jul 2023 07:53:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16BD18D0001; Mon, 17 Jul 2023 07:53:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0741A6B0072 for ; Mon, 17 Jul 2023 07:53:26 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D03A7120524 for ; Mon, 17 Jul 2023 11:53:25 +0000 (UTC) X-FDA: 81020943570.06.2E753A9 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf07.hostedemail.com (Postfix) with ESMTP id 158324001E for ; Mon, 17 Jul 2023 11:53:23 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=NgK1YF37; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of cem@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cem@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689594804; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1IAdq4n5/oIzAGmJbwcaTZVO+ZHOV/slhcqGbtISZa0=; b=zRhJFaDXIo5+XQvjts4677rwTdI/V5g1VSgcLLQXhl8y7MVkwcJKXi68G2mZbV/tSdUv5c QeS4663TiNuk+7zDeP/eBjxvCAEW6ozF6k0fsCae2Y5aToKsck9mXyuXb4m4auNIieYxS+ Lfel8p+ICSK1rVrePAAsayoluTD2BC4= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=NgK1YF37; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of cem@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cem@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689594804; a=rsa-sha256; cv=none; b=6CU34jHBGpXiLn0uKyKQ9n2evKqyBCVx8FnuzUbldevKFrGvRg0MfuYXM4WO8gB5nCX4hr oz0a0TSJOl9V9m7u3c8iGC4SCW7cWY2gOCZ1vQk9jJQGIgo2l9erMYJKh7KwAwVZQFEmRz oAF0nvmPvnagDRmhfnWHCvWmbLtKUQM= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0818A6103C; Mon, 17 Jul 2023 11:53:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F7C3C433C7; Mon, 17 Jul 2023 11:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689594802; bh=okwg5m+9iRcDR+mIe+e593XoCBrrkAftdLKtFY7t22A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NgK1YF37XbP9j3RFJRCOWrO8Z9eFBFeaswFRaTRK52mri/14LvTVamSqGrfkgET5I 73ZJ9jFmvCb6Isbl6smJZ3tyVwdYWxF7Ahwog+f2fAJ+qwp50vML0CSnryw9G8SsD4 My7IO/bcA1u4OS/SVGzwTFUp7cbgm5yYgvsUUbCtkCaFfiqMrwB+vy1KpVkb4uOFw2 2mIr7dt13Gt+/Wfj8sJvphMtH1u7YsXK0+4kw9AQ+mL4YC4UbU+TDNJlJYmOk9lnfA sOBjeCrdsfzE7ENtPNcixHssScYzPx6wbx/6f/KdxtYY1nDOVuRfuFOGZap7atOG28 Ry5dPQ9XUWn4g== From: cem@kernel.org To: linux-fsdevel@vger.kernel.org Cc: jack@suse.cz, akpm@linux-foundation.org, viro@zeniv.linux.org.uk, linux-mm@kvack.org, djwong@kernel.org, hughd@google.com, brauner@kernel.org, mcgrof@kernel.org Subject: [PATCH 3/6] quota: Check presence of quota operation structures instead of ->quota_read and ->quota_write callbacks Date: Mon, 17 Jul 2023 13:52:13 +0200 Message-Id: <20230717115212.208651-4-cem@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230717115212.208651-1-cem@kernel.org> References: <20230717115212.208651-1-cem@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 158324001E X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: jopxeeycc94dqzra55xzk8ukcuewz7sg X-HE-Tag: 1689594803-84931 X-HE-Meta: U2FsdGVkX1+O9AsesjbzO/nU9kGxOWmRddLUxjdzbCmXifkCACF7/aHyFiBtF1T3L+VRLPinJMzDQSwktMhGxGKeg3OdxihkQ0FW0+LnwsQyxcL7u6cxi7Ga8CPhHu9JbULaSKAzdtYFDY10qpNNVcTcd6n5oqAgVfsX04RV8IvUKvZHCN+TuNO+6cDW4sBOokaS+V5uR5ysJmUExN6RG10IiBdhq4Nig+bqWO/tSRT9V4z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Y2fP7hljF6ZBK7A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Jan Kara 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 --- fs/quota/dquot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index e3e4f4047657..4d826c369da2 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;