OpenVZ Forum - RDF feed
type: channel
items: [PATCH 1/4] NFS: make nfs_client_list per net ns
items: Re: [PATCH 1/4] NFS: make nfs_client_list per net ns

[PATCH 1/4] NFS: make nfs_client_list per net ns
type: item
description: This patch splits global list of NFS clients into per-net-ns array of lists. This looks more strict and clearer. BTW, this patch also makes "/proc/fs/nfsfs/servers" entry content depends on /proc mount owner pid namespace. See below for details. NOTE: few words about how was /proc/fs/nfsfs/ entries content show per network namespace done. This is a little bit tricky and not the best is could be. But it's cheap (proper fix for /proc conteinerization is a hard nut to crack). The idea is simple: take proper network namespace from pid namespace child reaper nsproxy of /proc/ mount creator. This actually means, that if there are 2 containers with different net namespace sharing pid namespace, then read of /proc/fs/nfsfs/ entries will always return content, taken from net namespace of pid namespace creator task (and thus second namespace set wil be unvisible). Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> --- fs/nfs/client.c | 38 +++++++++++++++++++++++++++----------- fs/nfs/idmap.c | 5 ++--- fs/nfs/inode.c | 1 + fs/nfs/internal.h | 2 +- fs/nfs/netns.h | 1 + 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 98af1cb..058eb9b 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -39,6 +39,8 @@ #include <net/ipv6.h> #include <linux/nfs_xdr.h> #include <linux/sunrpc/bc_xprt.h> +#include <linux/nsproxy.h> +#include <linux/pid_namespace.h> #include <asm/system.h> @@ -49,11 +51,11 @@ #include "internal.h" #include "fscache.h" #include "pnfs.h" +#include "netns.h" #define NFSDBG_FACILITY NFSDBG_CLIENT DEFINE_SPINLOCK(nfs_client_lock); -LIST_HEAD(nfs_client_list); static LIST_HEAD(nfs_volume_list); static DECLARE_WAIT_QUEUE_HEAD(nfs_client_active_wq); #ifdef CONFIG_NFS_V4 @@ -464,8 +466,9 @@ static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *dat { struct nfs_client *clp; const struct sockaddr *sap = data->addr; + struct nfs_net *nn = net_generic(data->net, nfs_net_id); - list_for_each…
creator: Stanislav Kinsbursky
date: 2012-01-23T17:26:05-00:00

Re: [PATCH 1/4] NFS: make nfs_client_list per net ns
type: item
description: I fixed up my bisect and identified this patch instead. The problem I'm seeing is: CC [M] fs/nfs/delegation.o CC [M] fs/nfs/idmap.o fs/nfs/idmap.c: In function 'rpc_pipefs_event': fs/nfs/idmap.c:535:9: error: implicit declaration of function 'net_generic' [-Werror=implicit-function-declaration] fs/nfs/idmap.c:535:50: error: 'nfs_net_id' undeclared (first use in this function) fs/nfs/idmap.c:535:50: note: each undeclared identifier is reported only once for each function it appears in fs/nfs/idmap.c:540:82: error: dereferencing pointer to incomplete type fs/nfs/idmap.c:540:224: error: dereferencing pointer to incomplete type cc1: some warnings being treated as errors make[2]: *** [fs/nfs/idmap.o] Error 1 make[1]: *** [fs/nfs] Error 2 make: *** [fs] Error 2 I think you need to add: #include "netns.h" to idmap.c. - Bryan On 01/23/12 12:26, Stanislav Kinsbursky wrote: > This patch splits global list of NFS clients into per-net-ns array of lists. > This looks more strict and clearer. > BTW, this patch also makes "/proc/fs/nfsfs/servers" entry content depends on > /proc mount owner pid namespace. See below for details. > > NOTE: few words about how was /proc/fs/nfsfs/ entries content show per network > namespace done. This is a little bit tricky and not the best is could be. But > it's cheap (proper fix for /proc conteinerization is a hard nut to crack). > The idea is simple: take proper network namespace from pid namespace > child reaper nsproxy of /proc/ mount creator. > This actually means, that if there are 2 containers with different net > namespace sharing pid namespace, then read of /proc/fs/nfsfs/ entries will > always return content, taken from net namespace of pid namespace creator task > (and thus second namespace set wil be unvisible). > > Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> > > --- > fs/nfs/client.c | 38 +++++++++++++++++++++++++++----------- > fs/nfs/idmap.c | 5 ++--- > fs/nfs/inode.c | 1 + > fs/nfs/internal.h | 2 +- > fs/nfs/netn…
creator: Bryan Schumaker
date: 2012-02-07T15:32:04-00:00

Re: [PATCH 1/4] NFS: make nfs_client_list per net ns
type: item
description: On Tue, 2012-02-07 at 10:32 -0500, Bryan Schumaker wrote: > I fixed up my bisect and identified this patch instead. The problem I'm seeing is: > > CC [M] fs/nfs/delegation.o > CC [M] fs/nfs/idmap.o > fs/nfs/idmap.c: In function 'rpc_pipefs_event': > fs/nfs/idmap.c:535:9: error: implicit declaration of function 'net_generic' [-Werror=implicit-function-declaration] > fs/nfs/idmap.c:535:50: error: 'nfs_net_id' undeclared (first use in this function) > fs/nfs/idmap.c:535:50: note: each undeclared identifier is reported only once for each function it appears in > fs/nfs/idmap.c:540:82: error: dereferencing pointer to incomplete type > fs/nfs/idmap.c:540:224: error: dereferencing pointer to incomplete type > cc1: some warnings being treated as errors > > make[2]: *** [fs/nfs/idmap.o] Error 1 > make[1]: *** [fs/nfs] Error 2 > make: *** [fs] Error 2 > > I think you need to add: #include "netns.h" to idmap.c. > > - Bryan That should already be there in the 'devel' branch. See commit 17347d03c008e2f504c33bb4905cdad0abc01319. -- Trond Myklebust Linux NFS client maintainer NetApp Trond.Myklebust@netapp.com www.netapp.com
creator: Myklebust, Trond
date: 2012-02-07T15:34:48-00:00

Re: [PATCH 1/4] NFS: make nfs_client_list per net ns
type: item
description: On 02/07/12 10:34, Myklebust, Trond wrote: > On Tue, 2012-02-07 at 10:32 -0500, Bryan Schumaker wrote: >> I fixed up my bisect and identified this patch instead. The problem I'm seeing is: >> >> CC [M] fs/nfs/delegation.o >> CC [M] fs/nfs/idmap.o >> fs/nfs/idmap.c: In function 'rpc_pipefs_event': >> fs/nfs/idmap.c:535:9: error: implicit declaration of function 'net_generic' [-Werror=implicit-function-declaration] >> fs/nfs/idmap.c:535:50: error: 'nfs_net_id' undeclared (first use in this function) >> fs/nfs/idmap.c:535:50: note: each undeclared identifier is reported only once for each function it appears in >> fs/nfs/idmap.c:540:82: error: dereferencing pointer to incomplete type >> fs/nfs/idmap.c:540:224: error: dereferencing pointer to incomplete type >> cc1: some warnings being treated as errors >> >> make[2]: *** [fs/nfs/idmap.o] Error 1 >> make[1]: *** [fs/nfs] Error 2 >> make: *** [fs] Error 2 >> >> I think you need to add: #include "netns.h" to idmap.c. >> >> - Bryan > > That should already be there in the 'devel' branch. See commit > 17347d03c008e2f504c33bb4905cdad0abc01319. > Yes, but once I fixed this I was able to find the initial problem I was searching for (I have no idea how git led me to the wrong patch on my first attempt). - Bryan
creator: Bryan Schumaker
date: 2012-02-07T15:44:32-00:00