Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5608282rwb; Mon, 14 Nov 2022 07:06:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Qhd9ykBNpwOMm3iCLkRxY1H1YNR1Q/J2V72t0i5fAhcrGcSRcm9WjdxroICS7G+ix7Erz X-Received: by 2002:a63:1011:0:b0:46f:f432:a3fa with SMTP id f17-20020a631011000000b0046ff432a3famr11879522pgl.125.1668438391657; Mon, 14 Nov 2022 07:06:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668438391; cv=none; d=google.com; s=arc-20160816; b=tNouxcSE06Xzf1M12m1kS5Tm+UPnGlealHJ+YRjdW3cf4PfBWBYrqukIah5rc++vQg mLIBO2Y039SFU3aT6bGMUAn1i5u5RrgauXy3rzyBgyu2tlLtFy8bPLvP41bj5EtTfrew iC/Aq0QX9rd6SJjl0mDMUK+mXXI91nedoxI4d2/kIbwwPSFBjMAC2KvpGxE4G6j04ol8 XOAWK+BNi3Z9cqjFtsoDFbhhVAGTC7MIG/+6E6pxHTBucLcNOn+zzcGs68lF2sqeocGf KlRf3/JMdsnXrQ0p0eZ6Wf94vWpKoEU8r9puBXaFhmFSCBw4pzxYguI2hXpNidI+LfDz vXeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=BQjRGUb90nQOdN6JT5RyHvQr6hOHreq1g2KVC8DUetM=; b=LQ19QFQMCHuVRpq2rLsIfbaFhGJ1vNE7oLpfANpRHmj+sdC6wea54pf9O9F1M5ysyH dKT7nUwKSRSwGtDpv6gr1EGTfKSsu/iPvAJInEvYcGrekveMcEjExPr6xpbBo6YYuxec VSmMhJkSDwv1Hh6OfaotWQ8FQUq/IDS6ZWR35zvAv0ircFLuhLEVJd4BoeA7TtsNcrrp Gbpnv55IXL4z95vU+RgyLhD4T+PJkkxy+VAJY4qVLQW0ka/gXQnd0HAzrEWb2ekeMngY IwKMpC1JaKpAGDZ8GnxUT2A39k26eEowT6HKwOaWVD9WNjeuzOzgyYzSnUtdsqDomTZt T5og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ki4aTxzx; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a17090a948a00b00205ebfd6d35si8669117pjo.76.2022.11.14.07.06.17; Mon, 14 Nov 2022 07:06:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ki4aTxzx; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236375AbiKNPCu (ORCPT + 99 others); Mon, 14 Nov 2022 10:02:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237080AbiKNPCo (ORCPT ); Mon, 14 Nov 2022 10:02:44 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBF0722B0A; Mon, 14 Nov 2022 07:02:43 -0800 (PST) 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 4D8F1611BD; Mon, 14 Nov 2022 15:02:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F541C433B5; Mon, 14 Nov 2022 15:02:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668438162; bh=a/M/1yxUU4iYIOYE9x1Z1vSjcrb3/s/dP4Ig3YsXU7k=; h=From:To:Cc:Subject:Date:From; b=ki4aTxzxZwY66+CmURYuwfmNsD1Ziw2UP0ORPQ2ZFbOxCNpMjk3yi7idjYuyYkfUx AebzVxOPpUJCmjiU7PbZ7RNKKEv8JNiPPnXsI2y8fbn6h66Y5TsNnDQIPuH1kkyXJ4 PKIAg6xo0AGfOQqJDUcFbdU/BiUiuk4+vVEqAnGg+uK/Ve6ohBCsU4hqsz1cnpy6dN ez89DupOFBDPASVgZXs18FTFRaLh3g95Z3OO7pbwls9DUuaL/5z3ZgMB1Os4LtSVYm VGUS5e3D4Aa67Yf0+P0rw404apIlJ4jE9fsCL4Q6uZZheKx+rwFXfddw6lrr+lmfuZ BfSEDme/WpT1Q== From: Jeff Layton To: chuck.lever@oracle.com, linux-fsdevel@vger.kernel.org Cc: trond.myklebust@hammerspace.com, linux-nfs@vger.kernel.org Subject: [PATCH 0/3] filelock: remove redundant filp arguments from API Date: Mon, 14 Nov 2022 10:02:37 -0500 Message-Id: <20221114150240.198648-1-jlayton@kernel.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Some of the exported functions in fs/locks.c take both a struct file argument and a struct file_lock. struct file_lock has a dedicated field to record which file it was set on (fl_file). This is redundant, and there have been some cases where the two didn't match [1], leading to bugs. This patchset is intended to remove this ambiguity by eliminating the separate struct file argument from vfs_lock_file, vfs_test_lock and vfs_cancel_lock. Most callers are easy to vet to ensure that they set this correctly, but lockd had a few places where it wasn't doing the right thing. This series depends on the lockd patches I sent late last week [2]. I'm targeting this series for v6.3. I'll plan to get it into linux-next soon unless there are objections. [1]: https://bugzilla.kernel.org/show_bug.cgi?id=216582 [2]: https://lore.kernel.org/linux-nfs/20221111215538.356543-1-jlayton@kernel.org/T/#t Jeff Layton (3): filelock: remove redundant filp argument from vfs_lock_file filelock: remove redundant filp argument from vfs_test_lock filelock: remove redundant filp arg from vfs_cancel_lock fs/ksmbd/smb2pdu.c | 4 ++-- fs/lockd/svclock.c | 21 +++++++-------------- fs/lockd/svcsubs.c | 4 ++-- fs/locks.c | 29 ++++++++++++++--------------- fs/nfsd/nfs4state.c | 6 +++--- include/linux/fs.h | 14 +++++++------- 6 files changed, 35 insertions(+), 43 deletions(-) -- 2.38.1