Skip to content

Address netns refcount issues for localio

NeilBrown linux-nfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 of 25 patches 3 repliesIn review

6 of 25 patches are in this archive. The cover letter announces 25.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
14/25nfs_common: add NFS LOCALIO auxiliary protocol enablementfs/nfs_common/Makefile fs/nfs_common/nfslocalio.c include/linux/nfslocalio.h+145 -00 replies
15/25nfs_common: introduce nfs_localio_ctx struct and interfacesfs/nfs_common/nfslocalio.c fs/nfsd/filecache.c fs/nfsd/filecache.h +2 more+228 -00 replies
16/25nfsd: add localio supportfs/Kconfig fs/nfsd/Kconfig fs/nfsd/Makefile +4 more+145 -20 replies
17/25nfsd: implement server support for NFS_LOCALIO_PROGRAMfs/nfsd/localio.c fs/nfsd/netns.h fs/nfsd/nfsctl.c +3 more+128 -10 replies
19/25nfs: add localio supportfs/nfs/Kconfig fs/nfs/Makefile fs/nfs/client.c +7 more+756 -00 replies
23/25nfs: implement client support for NFS_LOCALIO_PROGRAMfs/nfs/client.c fs/nfs/localio.c+132 -60 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchChuck LeverJeff Layton
14/25
15/25
16/25A-b R-b
17/25A-b R-b
19/25
23/25

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v14-plus 00/25] Address netns refcount issues for localio

Following are revised versions of 6 patches from the v14 localio series.

The issue addressed is net namespace refcounting.

We don't want to keep a long-term counted reference in the client because that prevents a server container from completely shutting down.

So we avoid taking a reference at all and rely on the per-cpu reference to the server being sufficient to keep the net-ns active. This involves allowing the net-ns exit code to iterate all active clients and clear their ->net pointers (which they need to find the per-cpu-refcount for the nfs_serv).

So:
- embed nfs_uuid_t in nfs_client. This provides a list_head that can be used to find the client. It does add the actual uuid to nfs_client so it is bigger than needed. If that is really a problem we can find a fix.

- When the nfs server confirms that the uuid is local, it moves the nfs_uuid_t onto a per-net-ns list.

- When the net-ns is shutting down - in a "pre_exit" handler, all these nfS_uuid_t have their ->net cleared. There is an rcu_synchronize() call between pre_exit() handlers and exit() handlers so and caller that sees ->net as not NULL can safely check the ->counter

- We now pass the nfs_uuid_t to nfsd_open_local_fh() so it can safely look at ->net in a private rcu_read_lock() section.

I have compile tested this code but nothing more.

Thanks,
NeilBrown

[PATCH 14/25] nfs_common: add NFS LOCALIO auxiliary protocol [PATCH 15/25] nfs_common: introduce nfs_localio_ctx struct and [PATCH 16/25] nfsd: add localio support
[PATCH 17/25] nfsd: implement server support for NFS_LOCALIO_PROGRAM [PATCH 19/25] nfs: add localio support
[PATCH 23/25] nfs: implement client support for NFS_LOCALIO_PROGRAM