From patchwork Tue Feb 6 14:52:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 197477 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1591644dyb; Tue, 6 Feb 2024 06:53:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzDeBBvwHB8PrZafVp3rvHmSWIPrR+U4lXkhoGYsfd0rkCP9EquaXbFYUNSuEq8CcP3hZ0 X-Received: by 2002:a05:6358:2822:b0:176:abf:3777 with SMTP id k34-20020a056358282200b001760abf3777mr2482845rwb.28.1707231223210; Tue, 06 Feb 2024 06:53:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707231223; cv=pass; d=google.com; s=arc-20160816; b=aELBh57Npsdjp+UA+a5PaPvrikEG3uVQT429ZbJbSgHJCEb+W09cBI8FW+Tpre2QQk Rtatkg/bw/3Xj61zjttfVXiq1QWTTaFQPpTsyQeWKXX5jcvozJ+cLScuoprIschTAM21 2AzcUkpUhNglGvGl9cKXW9WKnaBMPI2QZIM4RQgXVoDHstAfP3psHooxFJqAnunJ1wWY t6VpStcaryMBzKtG1FZBSM9Kz5ESh4r11ljGoMJrglOiz256yJPA08ks6Hg+CksozqyQ TCh4alitZCyX3p0qvFZcJ13/H7OmaOqQndJaP6eAQUBpA+UKIwtWj5gGL9M4qSS41+bb 01JA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=7jK/VxnSAyz/EP9Jd9QBpT2p7XLs3r60SMsg7GDgqaE=; fh=YAwyMHlz974HaT+kyz2Hu01+o9uGNa/2vIr4LwiC1IM=; b=QBs+rg/oB2fs9ioqKWh+uGfpfHv+x+b1KQfgZ9wxtpsol5Jrzisywb+jtOHoZNPG0N AerwkiqMpAK1gyYLz3j/+zMqb2b+MeQ9fUZWn2KJ4Ynwvp6qPXkT0PyYVRARS63yA67T XzUYROqa3qxjSipqDW0f4BSa8DSOqKc/dpXh96mnVTDacB2jXsRgZoLWo+IlCnmxL8nI Ujg11OEwM0M3k1NTf2/XkoWuVnIWW6MjunXlD/44dzDpUYG+5nMqy66vnh6GttskaFiR Cq1zkJG5VtVEN2rKtVtNUo2Zut2KjbEaGxODPihVb+5iL5fRouH+IHUUlyjE4DpwZzLp JcXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="VlwG/D5t"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55146-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55146-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCUujs+Djme+W8MyPnZSwB6l2x1Bqaoz5JYXD8PBVENJYVMN+Vl8vg4vn1dbVXuRTumbBs5HMlBxmkAR13nMDao12r1NfA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a124-20020a636682000000b005d8bbf7e78bsi1807812pgc.307.2024.02.06.06.53.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 06:53:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55146-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="VlwG/D5t"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55146-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55146-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F14DC285E5C for ; Tue, 6 Feb 2024 14:53:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84FB413341C; Tue, 6 Feb 2024 14:52:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VlwG/D5t" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3373131E40; Tue, 6 Feb 2024 14:52:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231174; cv=none; b=BmdJVrBGUKcGGCOddcOVc3yo82MO50AZdq9FuRVbSVAVm7mMk5zpekwQcz3CMTg5DFb+sNJmjho9EWk+uy4K1X6DluLwwVlqVbSlZi+MiqhBS0Dbx/xRRzYzLv2sJ1+nWQUUQUNe2ZZ5RdN1GI57+F/K5bfY4p3lJly39bB9/x4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231174; c=relaxed/simple; bh=WM6G8+4SZkOtjR5TKR7CAXeyhI3wvKML7VzcZML8OWo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=QS6e+DQIQnQV+ZrR3J+Lxz+6Te0hENL4wJXUDj36fdT708c81xLxr4qfNYknnaBjzgf9sPnqcQr5ZjHyDqOoNzFYKgZ56QxlhCD6jBXz7jtf5fd2rFUvsZ+DoelPypJHa0KnC15UcHGEs2aXS1uK11Tu/4Q1FL2HY3lNMTYQwr4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VlwG/D5t; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A678BC433F1; Tue, 6 Feb 2024 14:52:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707231174; bh=WM6G8+4SZkOtjR5TKR7CAXeyhI3wvKML7VzcZML8OWo=; h=From:Date:Subject:To:Cc:From; b=VlwG/D5t+2JeXoqVpFAf7vTkRwYqTVz7krGVvLoEBc0xIFkcF/hk3A5t5HeFVLT6m T1THwDt/e6y/WLXJBXLOd0FM4X22o4fvUv9uxr7jL3V8e1doBRSzzREdhwozulHNMb vSwthXdFgGLGSxiatqBBgMeo+4otoV9YPrPph4esgl099thYUgF1L0GDyhL9+AXsfv df4tPcWfsgoti6riJYJ685M81tdiVVcj64GDAk7Ur/irQGKd0hPHICEGo98qnVqTaz Ga50WIU1CevHJyv85lcQfI8jvCg4hymHDjHkqrwBSE9qhs+CPVvxI40Yxs4xvnfdqL klUle3Qu52TKw== From: Jeff Layton Date: Tue, 06 Feb 2024 09:52:49 -0500 Subject: [PATCH] ceph: mark lock variable __maybe_unused in ceph_count_file_locks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240206-flsplit-v1-1-17497d0c1e14@kernel.org> X-B4-Tracking: v=1; b=H4sIAMBHwmUC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDIwMz3bSc4oKczBLdFJM0EyPzFMtUg8QUJaDqgqLUtMwKsEnRsbW1AL5 tN/VZAAAA To: Christian Brauner , Xiubo Li , Ilya Dryomov Cc: ceph-devel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot , Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1555; i=jlayton@kernel.org; h=from:subject:message-id; bh=WM6G8+4SZkOtjR5TKR7CAXeyhI3wvKML7VzcZML8OWo=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlwkfFR8f7zh3ukzkRgliPb0GctNJwERkyRt83s +DFJqcyI+yJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZcJHxQAKCRAADmhBGVaC FYOvD/9GMpgNxpq4H21CrUmYR5+jKs33o2/9lPtAbT6DHmL4/mAcx8AZgt+ZsESLnLGfSsk2A6G C0lUkJlUZTp515FJWMVKdJAbFhNMNIR4YT4wvMdko8pDnVJE34s0Hm2N1xVT7Uq3RthCHscf8Vl g1cfyySni5hjZTkuUVhG0JbvcQ+Pz7ZBMfsSxztv5hjqUmjStF3GVkTpLsSEZsyVJxEfRCvG/bH oYnKupZd7V9MqFRolYFNnfxl/U64D3vRot9udxBshgX+EBkU/n6PQsCdon/nLthvpoF0rHFHJSG vQwD1/0JCf58cHAI+49CxAh1j2BZtDxiMdHxGi425T1wwhAck9kWJKVkQ4Uu5uWQHoVoNbA3x9t /dQse0Hwa3mH+UUzuuWQojG3aIFy3kAIlUMae6f6DmH8CbZdfOY1oPsCdju9iGerwwx2OwYrvsz P0z6NE8QaQwmw7EdfJwIG+maXL2xfF6gI7YC1cbYIkr9wUChxVDJ2u9zH7OeNSP3HS2GvUCAGUG +GjBWhldW10uZ6da5YWvtVQUyzv9gEeL1BIiUwnRzYplqw6e20P4c50/17Cb3lM1FsqgUx2kgmi UUQ5wxcuLtCClRGCMQfocnOEwHRc+ER4ziOmmRvRO4B44zXGTZm0zhaCGhd6FAPvpRHTgWZH/B9 sPchd4DNDBr2A8w== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790161686908148293 X-GMAIL-MSGID: 1790161686908148293 The "lock" variable won't be used if CONFIG_FILE_LOCKING=n. We can't remove it altogether though, since we do need it for the for_each_file_lock loops. Reduce its scope and mark it __maybe_unused. Fixes: 3956f35fbd36 ("ceph: adapt to breakup of struct file_lock") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202402062210.3YyBVGF1-lkp@intel.com/ Signed-off-by: Jeff Layton --- This warning is fallout from the big file_lock re-org, so this should probably go in via Christian's tree. --- fs/ceph/locks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- base-commit: 77f8316a9199a752ffcd136bd01d0566f54e0ea9 change-id: 20240206-flsplit-d4f427d9e0ad Best regards, diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c index ebf4ac0055dd..edfbf94f0d14 100644 --- a/fs/ceph/locks.c +++ b/fs/ceph/locks.c @@ -377,7 +377,6 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl) void ceph_count_locks(struct inode *inode, int *fcntl_count, int *flock_count) { struct ceph_client *cl = ceph_inode_to_client(inode); - struct file_lock *lock; struct file_lock_context *ctx; *fcntl_count = 0; @@ -385,6 +384,8 @@ void ceph_count_locks(struct inode *inode, int *fcntl_count, int *flock_count) ctx = locks_inode_context(inode); if (ctx) { + struct file_lock __maybe_unused *lock; + spin_lock(&ctx->flc_lock); for_each_file_lock(lock, &ctx->flc_posix) ++(*fcntl_count);