The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/2] nfs: don't share pNFS DS connections between net namespaces
       [not found] ` <20250410-nfs-ds-netns-v2-1-f80b7979ba80@kernel.org>
@ 2025-04-11 13:57   ` Benjamin Coddington
  2025-04-11 14:10     ` Jeff Layton
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Coddington @ 2025-04-11 13:57 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Trond Myklebust, Anna Schumaker, Omar Sandoval, Sargun Dillon,
	linux-nfs, linux-kernel

On 10 Apr 2025, at 16:42, Jeff Layton wrote:

> Currently, different NFS clients can share the same DS connections, even
> when they are in different net namespaces. If a containerized client
> creates a DS connection, another container can find and use it. When the
> first client exits, the connection will which can lead to stalls in

                                         ^^ close ?

> other clients.
>
> Add a net namespace pointer to struct nfs4_pnfs_ds, and compare those
> value to the caller's netns in _data_server_lookup_locked() when
> searching for a nfs4_pnfs_ds to match.
>
> Reported-by: Omar Sandoval <osandov@osandov.com>
> Reported-by: Sargun Dillon <sargun@sargun.me>
> Closes: https://lore.kernel.org/linux-nfs/Z_ArpQC_vREh_hEA@telecaster/
> Tested-by: Sargun Dillon <sargun@sargun.me>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Looks good to me,

Reviewed-by: Benjamin Coddington <bcodding@redhat.com>

Ben


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

* Re: [PATCH v2 2/2] nfs: move the nfs4_data_server_cache into struct nfs_net
       [not found] ` <20250410-nfs-ds-netns-v2-2-f80b7979ba80@kernel.org>
@ 2025-04-11 14:08   ` Benjamin Coddington
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Coddington @ 2025-04-11 14:08 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Trond Myklebust, Anna Schumaker, Omar Sandoval, Sargun Dillon,
	linux-nfs, linux-kernel

On 10 Apr 2025, at 16:42, Jeff Layton wrote:

> Since struct nfs4_pnfs_ds should not be shared between net namespaces,
> move from a global list of objects to a per-netns list and spinlock.
>
> Tested-by: Sargun Dillon <sargun@sargun.me>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Reviewed-by: Benjamin Coddington <bcodding@redhat.com>

Ben


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

* Re: [PATCH v2 1/2] nfs: don't share pNFS DS connections between net namespaces
  2025-04-11 13:57   ` [PATCH v2 1/2] nfs: don't share pNFS DS connections between net namespaces Benjamin Coddington
@ 2025-04-11 14:10     ` Jeff Layton
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2025-04-11 14:10 UTC (permalink / raw)
  To: Benjamin Coddington
  Cc: Trond Myklebust, Anna Schumaker, Omar Sandoval, Sargun Dillon,
	linux-nfs, linux-kernel

On Fri, 2025-04-11 at 09:57 -0400, Benjamin Coddington wrote:
> On 10 Apr 2025, at 16:42, Jeff Layton wrote:
> 
> > Currently, different NFS clients can share the same DS connections, even
> > when they are in different net namespaces. If a containerized client
> > creates a DS connection, another container can find and use it. When the
> > first client exits, the connection will which can lead to stalls in
> 
>                                          ^^ close ?
> 

Yes, thanks. Trond/Anna, can you fix before merging?

> > other clients.
> > 
> > Add a net namespace pointer to struct nfs4_pnfs_ds, and compare those
> > value to the caller's netns in _data_server_lookup_locked() when
> > searching for a nfs4_pnfs_ds to match.
> > 
> > Reported-by: Omar Sandoval <osandov@osandov.com>
> > Reported-by: Sargun Dillon <sargun@sargun.me>
> > Closes: https://lore.kernel.org/linux-nfs/Z_ArpQC_vREh_hEA@telecaster/
> > Tested-by: Sargun Dillon <sargun@sargun.me>
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> 
> Looks good to me,
> 
> Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
> 
> Ben
> 

Thank you!
-- 
Jeff Layton <jlayton@kernel.org>

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

end of thread, other threads:[~2025-04-11 14:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250410-nfs-ds-netns-v2-0-f80b7979ba80@kernel.org>
     [not found] ` <20250410-nfs-ds-netns-v2-1-f80b7979ba80@kernel.org>
2025-04-11 13:57   ` [PATCH v2 1/2] nfs: don't share pNFS DS connections between net namespaces Benjamin Coddington
2025-04-11 14:10     ` Jeff Layton
     [not found] ` <20250410-nfs-ds-netns-v2-2-f80b7979ba80@kernel.org>
2025-04-11 14:08   ` [PATCH v2 2/2] nfs: move the nfs4_data_server_cache into struct nfs_net Benjamin Coddington

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