Skip to content

SUNRPC: rework cache upcall to avoid NFSd root

Stanislav Kinsbursky linux-nfs lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 4 repliesIn review
  2. v1 RFC4 patches 6 repliesSuperseded

Changes in v2 from the cover letter

1) NFS DNS cache update wasn't done in the firest version. So this patch set does preparation cleanup of the NFS DNS cache routines.
2) Also, this patch set doesn't remove cache_upcall helper anymore, because it's still required for NFS DNS cache.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6NFS: use SUNRPC cache creation and destruction helper for DNS cachefs/nfs/dns_resolve.c+25 -351 reply
2/6NFS; simlify and clean cache libraryfs/nfs/cache_lib.c fs/nfs/cache_lib.h fs/nfs/dns_resolve.c+4 -161 reply
3/6SUNRPC: introduce cache_detail->cache_request callbackfs/nfs/dns_resolve.c fs/nfsd/export.c fs/nfsd/nfs4idmap.c +3 more+20 -80 replies
4/6SUNRPC: rework cache upcall logicfs/nfsd/export.c fs/nfsd/nfs4idmap.c net/sunrpc/auth_gss/svcauth_gss.c +2 more+7 -490 replies
5/6SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() functionfs/nfs/dns_resolve.c include/linux/sunrpc/cache.h net/sunrpc/cache.c+5 -130 replies
6/6SUNRPC: move cache_detail->cache_request callback call to cache_read()net/sunrpc/cache.c+20 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] SUNRPC: rework cache upcall to avoid NFSd root

swapping

The main idea of this patch set is to call cache request not on kthread upcall, but on userspace daemon cache_read call. This fixes the problem with gaining of wrong dentry path after calling d_path() in kthread root context (svc_export_request() callback), which always work in init root context, but containers can work in "root jail" - i.e. have it's own nested root.

v2:
1) NFS DNS cache update wasn't done in the firest version. So this patch set does preparation cleanup of the NFS DNS cache routines.
2) Also, this patch set doesn't remove cache_upcall helper anymore, because it's still required for NFS DNS cache.

The following series implements...

---

Stanislav Kinsbursky (6):
NFS: use SUNRPC cache creation and destruction helper for DNS cache NFS; simlify and clean cache library
SUNRPC: introduce cache_detail->cache_request callback
SUNRPC: rework cache upcall logic
SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function
SUNRPC: move cache_detail->cache_request callback call to cache_read()

 fs/nfs/cache_lib.c                |   12 ++-----
 fs/nfs/cache_lib.h                |    2 -
 fs/nfs/dns_resolve.c              |   65 +++++++++++++++----------------------
 fs/nfsd/export.c                  |   14 +-------
 fs/nfsd/nfs4idmap.c               |   16 +--------
 include/linux/sunrpc/cache.h      |   10 +++---
 net/sunrpc/auth_gss/svcauth_gss.c |    8 +----
 net/sunrpc/cache.c                |   49 ++++++++++++++++------------
 net/sunrpc/svcauth_unix.c         |   14 +-------
 9 files changed, 69 insertions(+), 121 deletions(-)