Linux NFS development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] nfs: don't share pNFS DS connections between net namespaces
@ 2025-04-10 20:42 Jeff Layton
  2025-04-10 20:42 ` [PATCH v2 1/2] " Jeff Layton
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jeff Layton @ 2025-04-10 20:42 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker
  Cc: Omar Sandoval, Sargun Dillon, linux-nfs, linux-kernel,
	Jeff Layton

Sargun noted that he had seen some cases where a dead netns with a stuck
NFS mount in it would affect other containers. Omar took a look last
week and noted that there was a global list of DS connections and there
was no segregation by namespace.

The first patch in the series fixes this in a minimal way by tracking
struct net in the nfs4_pnfs_ds structure and not matching it when the
caller's net is different. The second patch goes the rest of the way,
and makes the nfs4_data_server_cache and lock be per-net.

My thought was that the first patch should be suitable for stable
kernels, and both could go to mainline. If you think the risk is low
though, we could just squash the two together.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Changes in v2:
- fix build break when IS_ENABLED(CONFIG_NFS_V4_1) is false
- Link to v1: https://lore.kernel.org/r/20250410-nfs-ds-netns-v1-0-cc6236e84190@kernel.org

---
Jeff Layton (2):
      nfs: don't share pNFS DS connections between net namespaces
      nfs: move the nfs4_data_server_cache into struct nfs_net

 fs/nfs/client.c                           |  7 +++++++
 fs/nfs/filelayout/filelayoutdev.c         |  6 +++---
 fs/nfs/flexfilelayout/flexfilelayoutdev.c |  6 +++---
 fs/nfs/netns.h                            |  6 +++++-
 fs/nfs/pnfs.h                             |  4 +++-
 fs/nfs/pnfs_nfs.c                         | 32 +++++++++++++++++--------------
 6 files changed, 39 insertions(+), 22 deletions(-)
---
base-commit: cf03f570936ac96ed4775eb2e4f1a6ab6a13f143
change-id: 20250410-nfs-ds-netns-321c78c16a79

Best regards,
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-04-21 13:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-10 20:42 [PATCH v2 0/2] nfs: don't share pNFS DS connections between net namespaces Jeff Layton
2025-04-10 20:42 ` [PATCH v2 1/2] " Jeff Layton
2025-04-11 13:57   ` Benjamin Coddington
2025-04-11 14:10     ` Jeff Layton
2025-04-10 20:42 ` [PATCH v2 2/2] nfs: move the nfs4_data_server_cache into struct nfs_net Jeff Layton
2025-04-11 14:08   ` Benjamin Coddington
2025-04-21 13:30 ` [PATCH v2 0/2] nfs: don't share pNFS DS connections between net namespaces Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox