From patchwork Thu Jul 13 13:48:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Maiolino X-Patchwork-Id: 13312236 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 D1DACC0015E for ; Thu, 13 Jul 2023 13:49:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6CBBE90000F; Thu, 13 Jul 2023 09:49:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 67B6090000B; Thu, 13 Jul 2023 09:49:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5446C90000F; Thu, 13 Jul 2023 09:49:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 45CFD90000B for ; Thu, 13 Jul 2023 09:49:10 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 1F2891A0256 for ; Thu, 13 Jul 2023 13:49:10 +0000 (UTC) X-FDA: 81006720060.05.85765F8 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id 22036140008 for ; Thu, 13 Jul 2023 13:49:07 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=RgP5nZT9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.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=1689256148; 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=grY4ONXhMmyKnyfsvV7qPlqQgN2LmwkX1IMV4wSWUT2LPrVofKhgIna6+Cm7Vv5a7ABtj1 nhY/RzRbTtcl6RRomLrIrgcmlCoyhWlUb/1RWDpWgqEHWLwWMFcOYbTeDEDS7spZyg/vyP 6vRJ6DpHiOL+1IhPWyyqV+vYiya+LyE= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=RgP5nZT9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.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=1689256148; a=rsa-sha256; cv=none; b=HotUYae2QAw8eH+Wzop/IFgZYJjD4Ss7alW2iKuKtxR92DmvfjIpNEIOVGj8s59EbGBZmL avO/qvOfp43Ehw/eI8lsGiV5qz/KPq1R8sdAIpaFiWMCRqktLg0XId1dcHQiln9+F5arW1 aWnGbmNt702KRJZnMvW5JhLPjsvPNXs= 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 3686961539; Thu, 13 Jul 2023 13:49:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AED43C433CD; Thu, 13 Jul 2023 13:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689256146; bh=okwg5m+9iRcDR+mIe+e593XoCBrrkAftdLKtFY7t22A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RgP5nZT990UkDxviYs+LUZ/HPon2RZaJfpBtPgi1kRxGWXeX6s+bh+amI0VXt09iG eHVT7xfKVNPXE2H6fNVrJovWYUYZynW5ITk9v9t9uU+9PX6T7Ub4+Xy7Bltj6ixQxz hnpTQB+PkAde7nzTp3V97Ph0hCRt8tl5VmXxnya+/zEDKkBma0fZT/V3+6RK4lGg5l AfkivvgOYA9ibjzCjxO4mAteKSKrKko5Ulm4ixlcGFgnjbN/05+javYG1cEoDT8Oo0 C8IXojGKpMu52V7SnhFqA7PD6S4UDvoXs8EWCf/Yq0OPePeslYAJrM286JBNRFjaze 5CAYK6mI+Ci7Q== 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: Thu, 13 Jul 2023 15:48:45 +0200 Message-Id: <20230713134848.249779-4-cem@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713134848.249779-1-cem@kernel.org> References: <20230713134848.249779-1-cem@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 22036140008 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: sbyb8qoow73reifgj5u88rpw8rwaejp5 X-HE-Tag: 1689256147-591119 X-HE-Meta: U2FsdGVkX1+15QbPtauFqzo4GMe8/c54FV9JYr/rrULD9GiufCxG96I3roSQYHnxaL6T9yVQhYApPBVsNdcWP5cVan85Drdq7ZBFbBuR0xp9V+rp1KRbAEYyjmCQlQ3RSxt60Dt2HoeO49uGES3hUFhv6Ya0Yy8mmWzmMeKNy550h0cjcwcWeqkM+KOejCavVZoDtKTC4ltgSKgtaQo/fXiIJDxfMUAC3vqfctxX66sWJHCgEcV+MkcSuRsIGm9klicsjxoCmctsG+WKwkY0VUXS3oNMYYmB4+uuV4yBM2sqnkp4o/hc4LlR0/pHOp75CnGItbWpV90zsVBNorcbRXgTJnkoB1f+vJws/VSxZmKy7bvcWSTq3OY/7jNj01crKibfrq7yo/9elA48wHWYj8KuNNgSSPCUJfcukyYAE1JrUlROv0Y7fa2vER4D139WjZLOyo5XOR974+V5m22O5FulDBC4Qq9ETPDRPzVdMEjttMz7Dlr636j4g9S1TkiX9rkz95DY4riIJceWxhjC7Yl7XEb69kBiVxTPcUUTWUHmM/SGBuXISzDinFeGyJ6F06dmnfoLfT6guWRppkQCkOJCAdNLpLxM9etvDLtYhKCtc7a/4mamhZUpXn+lPYr1cf+cUfdfEisbyrHBm2umORTo/Y1IOm2jqIIwkVxo8YpdK9e96Je7y1qGd1eqTykFpM+qZFZYAgFJ5CcngjbqvOvrYuSNC0KlrwaAb069Ws5v7l2VeiAJQgc2PotubxHRxuuj/FC8z7bhYe0G99hCIjHRacJTR8uYzxB9pPZlK4LcJD44EoiW6abpGRabl4Zw8dqwgi+SvbhZFbyq2UuPE/vZZ/dDQH6Jz5baaRbMxh4XZJ6SODxGMjf2l10mwYQzPpyOaew55cbVdjAcDESogbP99nQR33Ax6/68JzjZc2vh/1a7F773KCPGwohRGUPLMlYmALlPKRTZ5oSuzG9 TgOtO1ET w+O6N5qjPxOSuXu327ImLkhrG3T9HZGI3CGYXaEQIP4I+o9al+Rc1/ygXLRnd6iTz2dq0aJWh5EV1WAP5quRBo9Z4Gesp/5vKqvheUCCPDXpXOdTbrDsm0XpksemMvtAUj5s8EllLnf4+Qw3Fnn+CIq1rs/mBqt5jl+mCVk2oimc9NuYApwJkxftvzNzFZqsPnfIYqwlhzxYCOcaWk25mD/wFqH5yJ95pGmdienMJUAPGDnTDOr4GFId4VBOe139T0qNv 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;