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@xxxxxxxxxx> --- 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@xxxxxxxxxx --- 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@xxxxxxxxxx>