From patchwork Mon Apr 3 08:47:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Maiolino X-Patchwork-Id: 13197810 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 C4B18C77B62 for ; Mon, 3 Apr 2023 08:48:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 653746B0075; Mon, 3 Apr 2023 04:48:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5DC8E6B0078; Mon, 3 Apr 2023 04:48:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 47C456B007B; Mon, 3 Apr 2023 04:48:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 39BD26B0075 for ; Mon, 3 Apr 2023 04:48:23 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 14863A0492 for ; Mon, 3 Apr 2023 08:48:23 +0000 (UTC) X-FDA: 80639453286.19.ABB94CB Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf24.hostedemail.com (Postfix) with ESMTP id 74EE218001A for ; Mon, 3 Apr 2023 08:48:20 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=g9nWUEEM; spf=pass (imf24.hostedemail.com: domain of cem@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cem@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680511700; 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=dYlc1jmimOpu++fgK4m6NvvZQ7dOhc28V6dQJ5ItySQ=; b=Ooaw9f2Nu3+UF9FwD01jxWGAvx91UHm2wURBXfC846cRgloK6i3e5hsuPlaX2ljv+BH0Jq bHA6DDqbH7Vn4YCs55BHR9WhELjIb8pwFz3nvCov1gS0jI4xHDshDAKeN/Yd1VU1WXXA5J VNFiYLoFgFCiHi65p9AnAN9EVKtp/+8= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=g9nWUEEM; spf=pass (imf24.hostedemail.com: domain of cem@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cem@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680511700; a=rsa-sha256; cv=none; b=BI9q5nr8B6U35X8OoyM/JQowHaqNFqBcHx6OcMlcgfEUHlHuSkix5XPNFYVMuLfGQqCiQk uFOMZRkqSsi11CEOkjD+QEsJYtXPS2XXA4rKgz86dDrWDfiOv2KjrbNv8gQWDJ1En+xt+f zah1PFcKBQO1NVkLsvLu9NnDUvBiipc= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A95F060F5A; Mon, 3 Apr 2023 08:48:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC20DC4339C; Mon, 3 Apr 2023 08:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680511699; bh=Su2DoSY6BWVBfCUfk9QccjNDv0XP3B1+MpHIwHBykn0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g9nWUEEMRDid916NyRQuwKd2XaaGWV6PBImgZfSim19fxbwjlJ3bEV94rgC0h2+yG ZZVrsheSbTsqjsCaCDG98G2AEQGYjcvVZZVg/UD+UKI/0XSHNUvD+XHXxMgiwvgbe6 Ok/SsHK2nFBfSpOrN/M6T1FL2w94swHcw8AXKzBbiur1d5ivFpK5eOps8iHonayngv 37R96Q2TjCpqsRGJJGbjCSA6dTKDrm6yyHbmGrnU9u4ZvsbosQuiU9QVraHbACq3oa 5Hut+ESrPnQwO3Y0tUDvj7sVVlD29udS8iTCP1Zp/B539XMdpUaLddvAuX4wEClTFJ UfiZaMbADrhnA== From: cem@kernel.org To: hughd@google.com Cc: jack@suse.cz, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, djwong@kernel.org Subject: [PATCH 3/6] quota: Check presence of quota operation structures instead of ->quota_read and ->quota_write callbacks Date: Mon, 3 Apr 2023 10:47:56 +0200 Message-Id: <20230403084759.884681-4-cem@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230403084759.884681-1-cem@kernel.org> References: <20230403084759.884681-1-cem@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 74EE218001A X-Stat-Signature: irgzco7r8u6q8sfcxw9z6r85wduh6oaf X-HE-Tag: 1680511700-334447 X-HE-Meta: U2FsdGVkX1+jVOQd9LKRHFxfm2DuZnx/zDQyzla8G6qBZFEoHRwT9KrfqxESOMXqG0OIqo9d1IjcQausY7FS3CyAnfzRDFHdFEtu80u5K7Kiy7M/cDUWAhS/1yqW9eDuOwRgW1/GBwvnWijKD4CfTo9BICMp/3gvMp1Yfj4EHug6QLwlBvm/J3H5aC378rbrwRFqzbB0c8JLwmSWuNNdIwocMg8LcDZ7+CcsdB55WaMmonaX01v9Gm4M5d+NpPvaf+l8Z/NnwvFFxoKp47CI/Jbf8BR5abnvoUYP+IKwQYGRP4qYXCwrWoGJlBbLWVL0dTt1B+EeXa90lh8Yrnwrd+c1oStHmvkCYqaUzGWRrwfvK5Pz3H9GdIfTX55UYskwKHsm9O0H6HmOts+H6TkbIBj7Ru3ApmLV6gKA1JGfvaTYY+plwz+0udN7Vgtwo5ZCwwU56vIA4XhGiulH5NkyerikbDg4Umhwo1BH0P3NQdcfuekw3EStvRsQUzWrV+wtU+EAOzxdDNaO51izH0JPPREY/N43SaCS6xqL1a1vBR77Jq7GM0f6PhmfELcv+T33vKj/rvEC7x+vdNrc1GQH6L5uktyKKRfcEklxTuAhWDwm7RjzqdkvNEMMwxP+dXRsNWmLwmcsKoVU3PM8cxhXem6TwATAMoTlSLPNa21S0F0BEZ6uwbG9poozidipO9VlJZe0hUw6jiUG+BvCQDrsZq85gWQasJxD0W8zYleldibSLzKR9whxQpC9b6ufVDg211sDlMYpyzvF/hj8IpcO1W0KoseLSdtXa09knUZDG3HuhJDT0+DOpvzEPhpP6cT2HerkCGZKXMOhel+evaSv8qQCVlP3nMICRYoYczsZlLhjUmRDpmRCdiazooVDdb9GkMcZYmRJLxVLq05wffd7uyAgaf94mLyJiIBn5UA5SqkS6WOFrzAbVTwIlchQLRBaKXrVgHElBM+pvoU3B/s MejSf60v 0EuINV+r9Ujajfqg/mutQV5raw2yUW/5QWQjkZ+AQTsgfcF31VdoLgeQJJwxZHI1hjWHY1iMEDpP4MvWdnFOXIUdby46Gjz2t4dswR0G5qUnaTMjasTWUzw5YsbdCpYpR4Q6QyQHNekrzx/iRTIv1rszzuUwcxx5SHbLo5+xoBRBFkVMXv0n6js3iJoAWd0/u4TCHhuEpcygoyjpR5iYZ8RajE/exwBJWA6iySVXeoMualh3HMTT4cafP06Ui04j1I8gsf8tT/afsFsOWDbcKwdDPK5FXgQfuwNg5Fwrnb4NxB4kC21A4G8uXeK2soiBglVl1V4ftgTPIeq55mtZ4lfG9UA== 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 --- 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 a6357f728034a..81563a83b609d 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;