linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Scott Mayhew <smayhew@redhat.com>,
	Dave Wysochanski <dwysocha@redhat.com>,
	Anna Schumaker <Anna.Schumaker@Netapp.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-nfs@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 05/37] nfs: add minor version to nfs_server_key for fscache
Date: Wed, 18 Mar 2020 16:54:37 -0400	[thread overview]
Message-ID: <20200318205509.17053-5-sashal@kernel.org> (raw)
In-Reply-To: <20200318205509.17053-1-sashal@kernel.org>

From: Scott Mayhew <smayhew@redhat.com>

[ Upstream commit 55dee1bc0d72877b99805e42e0205087e98b9edd ]

An NFS client that mounts multiple exports from the same NFS
server with higher NFSv4 versions disabled (i.e. 4.2) and without
forcing a specific NFS version results in fscache index cookie
collisions and the following messages:
[  570.004348] FS-Cache: Duplicate cookie detected

Each nfs_client structure should have its own fscache index cookie,
so add the minorversion to nfs_server_key.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=200145
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/nfs/client.c     | 1 +
 fs/nfs/fscache.c    | 2 ++
 fs/nfs/nfs4client.c | 1 -
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 0a2b59c1ecb3d..07c5ddd5d6d50 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -157,6 +157,7 @@ struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init)
 	if ((clp = kzalloc(sizeof(*clp), GFP_KERNEL)) == NULL)
 		goto error_0;
 
+	clp->cl_minorversion = cl_init->minorversion;
 	clp->cl_nfs_mod = cl_init->nfs_mod;
 	if (!try_module_get(clp->cl_nfs_mod->owner))
 		goto error_dealloc;
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c
index a7bc4e0494f92..6f45b1a957397 100644
--- a/fs/nfs/fscache.c
+++ b/fs/nfs/fscache.c
@@ -35,6 +35,7 @@ static DEFINE_SPINLOCK(nfs_fscache_keys_lock);
 struct nfs_server_key {
 	struct {
 		uint16_t	nfsversion;		/* NFS protocol version */
+		uint32_t	minorversion;		/* NFSv4 minor version */
 		uint16_t	family;			/* address family */
 		__be16		port;			/* IP port */
 	} hdr;
@@ -59,6 +60,7 @@ void nfs_fscache_get_client_cookie(struct nfs_client *clp)
 
 	memset(&key, 0, sizeof(key));
 	key.hdr.nfsversion = clp->rpc_ops->version;
+	key.hdr.minorversion = clp->cl_minorversion;
 	key.hdr.family = clp->cl_addr.ss_family;
 
 	switch (clp->cl_addr.ss_family) {
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 86991bcfbeb12..faaabbedc891d 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -210,7 +210,6 @@ struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init)
 	INIT_LIST_HEAD(&clp->cl_ds_clients);
 	rpc_init_wait_queue(&clp->cl_rpcwaitq, "NFS client");
 	clp->cl_state = 1 << NFS4CLNT_LEASE_EXPIRED;
-	clp->cl_minorversion = cl_init->minorversion;
 	clp->cl_mvops = nfs_v4_minor_ops[cl_init->minorversion];
 	clp->cl_mig_gen = 1;
 #if IS_ENABLED(CONFIG_NFS_V4_1)
-- 
2.20.1


  parent reply	other threads:[~2020-03-18 21:04 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 20:54 [PATCH AUTOSEL 4.19 01/37] cgroup-v1: cgroup_pidlist_next should update position index Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 02/37] cgroup: Iterate tasks that did not finish do_exit() Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 03/37] batman-adv: Don't schedule OGM for disabled interface Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 04/37] pinctrl: meson-gxl: fix GPIOX sdio pins Sasha Levin
2020-03-18 20:54 ` Sasha Levin [this message]
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 06/37] pinctrl: core: Remove extra kref_get which blocks hogs being freed Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 07/37] r8152: check disconnect status after long sleep Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 08/37] bnxt_en: reinitialize IRQs when MTU is modified Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 09/37] cpupower: avoid multiple definition with gcc -fno-common Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 10/37] fib: add missing attribute validation for tun_id Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 11/37] can: add missing attribute validation for termination Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 12/37] macsec: add missing attribute validation for port Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 13/37] team: add missing attribute validation for port ifindex Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 14/37] team: add missing attribute validation for array index Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 15/37] netfilter: cthelper: add missing attribute validation for cthelper Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 16/37] netfilter: nft_payload: add missing attribute validation for payload csum flags Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 17/37] netfilter: nft_tunnel: add missing attribute validation for tunnels Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 18/37] drivers/of/of_mdio.c:fix of_mdiobus_register() Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 19/37] cgroup1: don't call release_agent when it is "" Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 20/37] dt-bindings: net: FMan erratum A050385 Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 21/37] arm64: dts: ls1043a: " Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 22/37] fsl/fman: detect " Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 23/37] virtio-blk: fix hw_queue stopped on arbitrary error Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 24/37] ipvlan: do not add hardware address of master to its unicast filter list Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 25/37] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 26/37] ipvlan: don't deref eth hdr before checking it's set Sasha Levin
2020-03-18 20:54 ` [PATCH AUTOSEL 4.19 27/37] ipvlan: add cond_resched_rcu() while processing muticast backlog Sasha Levin
2020-03-18 20:55 ` [PATCH AUTOSEL 4.19 28/37] ipvlan: do not use cond_resched_rcu() in ipvlan_process_multicast() Sasha Levin
2020-03-18 20:55 ` [PATCH AUTOSEL 4.19 29/37] i2c: gpio: suppress error on probe defer Sasha Levin
2020-03-18 20:55 ` [PATCH AUTOSEL 4.19 30/37] s390/qeth: handle error when backing RX buffer Sasha Levin
2020-03-18 20:55 ` [PATCH AUTOSEL 4.19 31/37] scsi: ipr: Fix softlockup when rescanning devices in petitboot Sasha Levin
2020-03-18 20:55 ` [PATCH AUTOSEL 4.19 32/37] mac80211: Do not send mesh HWMP PREQ if HWMP is disabled Sasha Levin
2020-03-18 20:55 ` [PATCH AUTOSEL 4.19 33/37] dpaa_eth: Remove unnecessary boolean expression in dpaa_get_headroom Sasha Levin
2020-03-18 20:55 ` [PATCH AUTOSEL 4.19 34/37] sxgbe: Fix off by one in samsung driver strncpy size arg Sasha Levin
2020-03-18 20:55 ` [PATCH AUTOSEL 4.19 35/37] net: systemport: fix index check to avoid an array out of bounds access Sasha Levin
2020-03-18 20:55 ` [PATCH AUTOSEL 4.19 36/37] iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint Sasha Levin
2020-03-18 20:55 ` [PATCH AUTOSEL 4.19 37/37] iommu/vt-d: Fix the wrong printing in RHSA parsing Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200318205509.17053-5-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Anna.Schumaker@Netapp.com \
    --cc=dwysocha@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=smayhew@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).