public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping
@ 2013-01-15  8:09 Stanislav Kinsbursky
  2013-01-15  8:09 ` [PATCH 1/4] SUNRPC: introduce cache_detail->cache_request callback Stanislav Kinsbursky
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Stanislav Kinsbursky @ 2013-01-15  8:09 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Trond.Myklebust, linux-kernel, devel

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.

The following series implements...

---

Stanislav Kinsbursky (4):
      SUNRPC: introduce cache_detail->cache_request callback
      SUNRPC: remove cache_detail->cache_upcall callback
      SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function
      SUNRPC: move cache_detail->cache_request callback call to cache_read()


 fs/nfs/dns_resolve.c              |    2 +-
 fs/nfsd/export.c                  |   14 ++----------
 fs/nfsd/nfs4idmap.c               |   16 ++-----------
 include/linux/sunrpc/cache.h      |   11 +++------
 net/sunrpc/auth_gss/svcauth_gss.c |    8 +------
 net/sunrpc/cache.c                |   44 ++++++++++++++++++++-----------------
 net/sunrpc/svcauth_unix.c         |   14 ++----------
 7 files changed, 36 insertions(+), 73 deletions(-)


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

* [PATCH 1/4] SUNRPC: introduce cache_detail->cache_request callback
  2013-01-15  8:09 [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping Stanislav Kinsbursky
@ 2013-01-15  8:09 ` Stanislav Kinsbursky
  2013-01-15  8:09 ` [PATCH 2/4] SUNRPC: remove cache_detail->cache_upcall callback Stanislav Kinsbursky
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Stanislav Kinsbursky @ 2013-01-15  8:09 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Trond.Myklebust, linux-kernel, devel

This callback will allow to simplify upcalls in further patches in this
series.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
 fs/nfs/dns_resolve.c              |    2 +-
 fs/nfsd/export.c                  |    6 ++++--
 fs/nfsd/nfs4idmap.c               |    6 ++++--
 include/linux/sunrpc/cache.h      |    4 ++++
 net/sunrpc/auth_gss/svcauth_gss.c |    3 ++-
 net/sunrpc/svcauth_unix.c         |    6 ++++--
 6 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c
index 31c26c4..90edbd0 100644
--- a/fs/nfs/dns_resolve.c
+++ b/fs/nfs/dns_resolve.c
@@ -142,7 +142,7 @@ static int nfs_dns_upcall(struct cache_detail *cd,
 
 	ret = nfs_cache_upcall(cd, key->hostname);
 	if (ret)
-		ret = sunrpc_cache_pipe_upcall(cd, ch, nfs_dns_request);
+		ret = sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
 	return ret;
 }
 
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index a3946cf..63ee3bc 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -69,7 +69,7 @@ static void expkey_request(struct cache_detail *cd,
 
 static int expkey_upcall(struct cache_detail *cd, struct cache_head *h)
 {
-	return sunrpc_cache_pipe_upcall(cd, h, expkey_request);
+	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
 }
 
 static struct svc_expkey *svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new,
@@ -246,6 +246,7 @@ static struct cache_detail svc_expkey_cache_template = {
 	.name		= "nfsd.fh",
 	.cache_put	= expkey_put,
 	.cache_upcall	= expkey_upcall,
+	.cache_request	= expkey_request,
 	.cache_parse	= expkey_parse,
 	.cache_show	= expkey_show,
 	.match		= expkey_match,
@@ -339,7 +340,7 @@ static void svc_export_request(struct cache_detail *cd,
 
 static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h)
 {
-	return sunrpc_cache_pipe_upcall(cd, h, svc_export_request);
+	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
 }
 
 static struct svc_export *svc_export_update(struct svc_export *new,
@@ -712,6 +713,7 @@ static struct cache_detail svc_export_cache_template = {
 	.name		= "nfsd.export",
 	.cache_put	= svc_export_put,
 	.cache_upcall	= svc_export_upcall,
+	.cache_request	= svc_export_request,
 	.cache_parse	= svc_export_parse,
 	.cache_show	= svc_export_show,
 	.match		= svc_export_match,
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index a1f10c0..9033dfd 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -142,7 +142,7 @@ idtoname_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
 static int
 idtoname_upcall(struct cache_detail *cd, struct cache_head *ch)
 {
-	return sunrpc_cache_pipe_upcall(cd, ch, idtoname_request);
+	return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
 }
 
 static int
@@ -193,6 +193,7 @@ static struct cache_detail idtoname_cache_template = {
 	.name		= "nfs4.idtoname",
 	.cache_put	= ent_put,
 	.cache_upcall	= idtoname_upcall,
+	.cache_request	= idtoname_request,
 	.cache_parse	= idtoname_parse,
 	.cache_show	= idtoname_show,
 	.warn_no_listener = warn_no_idmapd,
@@ -323,7 +324,7 @@ nametoid_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
 static int
 nametoid_upcall(struct cache_detail *cd, struct cache_head *ch)
 {
-	return sunrpc_cache_pipe_upcall(cd, ch, nametoid_request);
+	return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
 }
 
 static int
@@ -366,6 +367,7 @@ static struct cache_detail nametoid_cache_template = {
 	.name		= "nfs4.nametoid",
 	.cache_put	= ent_put,
 	.cache_upcall	= nametoid_upcall,
+	.cache_request	= nametoid_request,
 	.cache_parse	= nametoid_parse,
 	.cache_show	= nametoid_show,
 	.warn_no_listener = warn_no_idmapd,
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 5dc9ee4..4f1c858 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -83,6 +83,10 @@ struct cache_detail {
 	int			(*cache_upcall)(struct cache_detail *,
 						struct cache_head *);
 
+	void			(*cache_request)(struct cache_detail *cd,
+						 struct cache_head *ch,
+						 char **bpp, int *blen);
+
 	int			(*cache_parse)(struct cache_detail *,
 					       char *buf, int len);
 
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 73e9573..82437f9 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -184,7 +184,7 @@ static void rsi_request(struct cache_detail *cd,
 
 static int rsi_upcall(struct cache_detail *cd, struct cache_head *h)
 {
-	return sunrpc_cache_pipe_upcall(cd, h, rsi_request);
+	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
 }
 
 
@@ -276,6 +276,7 @@ static struct cache_detail rsi_cache_template = {
 	.name           = "auth.rpcsec.init",
 	.cache_put      = rsi_put,
 	.cache_upcall   = rsi_upcall,
+	.cache_request  = rsi_request,
 	.cache_parse    = rsi_parse,
 	.match		= rsi_match,
 	.init		= rsi_init,
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 4d01292..6b03cc1 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -159,7 +159,7 @@ static void ip_map_request(struct cache_detail *cd,
 
 static int ip_map_upcall(struct cache_detail *cd, struct cache_head *h)
 {
-	return sunrpc_cache_pipe_upcall(cd, h, ip_map_request);
+	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
 }
 
 static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class, struct in6_addr *addr);
@@ -472,7 +472,7 @@ static void unix_gid_request(struct cache_detail *cd,
 
 static int unix_gid_upcall(struct cache_detail *cd, struct cache_head *h)
 {
-	return sunrpc_cache_pipe_upcall(cd, h, unix_gid_request);
+	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
 }
 
 static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, uid_t uid);
@@ -578,6 +578,7 @@ static struct cache_detail unix_gid_cache_template = {
 	.name		= "auth.unix.gid",
 	.cache_put	= unix_gid_put,
 	.cache_upcall	= unix_gid_upcall,
+	.cache_request	= unix_gid_request,
 	.cache_parse	= unix_gid_parse,
 	.cache_show	= unix_gid_show,
 	.match		= unix_gid_match,
@@ -875,6 +876,7 @@ static struct cache_detail ip_map_cache_template = {
 	.name		= "auth.unix.ip",
 	.cache_put	= ip_map_put,
 	.cache_upcall	= ip_map_upcall,
+	.cache_request	= ip_map_request,
 	.cache_parse	= ip_map_parse,
 	.cache_show	= ip_map_show,
 	.match		= ip_map_match,


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

* [PATCH 2/4] SUNRPC: remove cache_detail->cache_upcall callback
  2013-01-15  8:09 [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping Stanislav Kinsbursky
  2013-01-15  8:09 ` [PATCH 1/4] SUNRPC: introduce cache_detail->cache_request callback Stanislav Kinsbursky
@ 2013-01-15  8:09 ` Stanislav Kinsbursky
  2013-02-04 16:50   ` Jeff Layton
  2013-01-15  8:09 ` [PATCH 3/4] SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function Stanislav Kinsbursky
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Stanislav Kinsbursky @ 2013-01-15  8:09 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Trond.Myklebust, linux-kernel, devel

This callback is redundant since all that its' implementations are doing is
calling sunrpc_cache_pipe_upcall() with proper function address argument. This
function address is now stored on cache_detail structure and thus all the code
can be simplified.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
 fs/nfsd/export.c                  |   12 ------------
 fs/nfsd/nfs4idmap.c               |   14 --------------
 include/linux/sunrpc/cache.h      |    3 ---
 net/sunrpc/auth_gss/svcauth_gss.c |    7 -------
 net/sunrpc/cache.c                |    6 +++---
 net/sunrpc/svcauth_unix.c         |   12 ------------
 6 files changed, 3 insertions(+), 51 deletions(-)

diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 63ee3bc..6f030a5 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -67,11 +67,6 @@ static void expkey_request(struct cache_detail *cd,
 	(*bpp)[-1] = '\n';
 }
 
-static int expkey_upcall(struct cache_detail *cd, struct cache_head *h)
-{
-	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
-}
-
 static struct svc_expkey *svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new,
 					    struct svc_expkey *old);
 static struct svc_expkey *svc_expkey_lookup(struct cache_detail *cd, struct svc_expkey *);
@@ -245,7 +240,6 @@ static struct cache_detail svc_expkey_cache_template = {
 	.hash_size	= EXPKEY_HASHMAX,
 	.name		= "nfsd.fh",
 	.cache_put	= expkey_put,
-	.cache_upcall	= expkey_upcall,
 	.cache_request	= expkey_request,
 	.cache_parse	= expkey_parse,
 	.cache_show	= expkey_show,
@@ -338,11 +332,6 @@ static void svc_export_request(struct cache_detail *cd,
 	(*bpp)[-1] = '\n';
 }
 
-static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h)
-{
-	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
-}
-
 static struct svc_export *svc_export_update(struct svc_export *new,
 					    struct svc_export *old);
 static struct svc_export *svc_export_lookup(struct svc_export *);
@@ -712,7 +701,6 @@ static struct cache_detail svc_export_cache_template = {
 	.hash_size	= EXPORT_HASHMAX,
 	.name		= "nfsd.export",
 	.cache_put	= svc_export_put,
-	.cache_upcall	= svc_export_upcall,
 	.cache_request	= svc_export_request,
 	.cache_parse	= svc_export_parse,
 	.cache_show	= svc_export_show,
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index 9033dfd..d9402ea 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -140,12 +140,6 @@ idtoname_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
 }
 
 static int
-idtoname_upcall(struct cache_detail *cd, struct cache_head *ch)
-{
-	return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
-}
-
-static int
 idtoname_match(struct cache_head *ca, struct cache_head *cb)
 {
 	struct ent *a = container_of(ca, struct ent, h);
@@ -192,7 +186,6 @@ static struct cache_detail idtoname_cache_template = {
 	.hash_size	= ENT_HASHMAX,
 	.name		= "nfs4.idtoname",
 	.cache_put	= ent_put,
-	.cache_upcall	= idtoname_upcall,
 	.cache_request	= idtoname_request,
 	.cache_parse	= idtoname_parse,
 	.cache_show	= idtoname_show,
@@ -322,12 +315,6 @@ nametoid_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
 }
 
 static int
-nametoid_upcall(struct cache_detail *cd, struct cache_head *ch)
-{
-	return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
-}
-
-static int
 nametoid_match(struct cache_head *ca, struct cache_head *cb)
 {
 	struct ent *a = container_of(ca, struct ent, h);
@@ -366,7 +353,6 @@ static struct cache_detail nametoid_cache_template = {
 	.hash_size	= ENT_HASHMAX,
 	.name		= "nfs4.nametoid",
 	.cache_put	= ent_put,
-	.cache_upcall	= nametoid_upcall,
 	.cache_request	= nametoid_request,
 	.cache_parse	= nametoid_parse,
 	.cache_show	= nametoid_show,
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 4f1c858..249e73a 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -80,9 +80,6 @@ struct cache_detail {
 	char			*name;
 	void			(*cache_put)(struct kref *);
 
-	int			(*cache_upcall)(struct cache_detail *,
-						struct cache_head *);
-
 	void			(*cache_request)(struct cache_detail *cd,
 						 struct cache_head *ch,
 						 char **bpp, int *blen);
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 82437f9..1bd18af 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -182,12 +182,6 @@ static void rsi_request(struct cache_detail *cd,
 	(*bpp)[-1] = '\n';
 }
 
-static int rsi_upcall(struct cache_detail *cd, struct cache_head *h)
-{
-	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
-}
-
-
 static int rsi_parse(struct cache_detail *cd,
 		    char *mesg, int mlen)
 {
@@ -275,7 +269,6 @@ static struct cache_detail rsi_cache_template = {
 	.hash_size	= RSI_HASHMAX,
 	.name           = "auth.rpcsec.init",
 	.cache_put      = rsi_put,
-	.cache_upcall   = rsi_upcall,
 	.cache_request  = rsi_request,
 	.cache_parse    = rsi_parse,
 	.match		= rsi_match,
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index fc2f7aa..ee6b5dd 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -196,9 +196,9 @@ EXPORT_SYMBOL_GPL(sunrpc_cache_update);
 
 static int cache_make_upcall(struct cache_detail *cd, struct cache_head *h)
 {
-	if (!cd->cache_upcall)
+	if (!cd->cache_request)
 		return -EINVAL;
-	return cd->cache_upcall(cd, h);
+	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
 }
 
 static inline int cache_is_valid(struct cache_detail *detail, struct cache_head *h)
@@ -1605,7 +1605,7 @@ static int create_cache_proc_entries(struct cache_detail *cd, struct net *net)
 	if (p == NULL)
 		goto out_nomem;
 
-	if (cd->cache_upcall || cd->cache_parse) {
+	if (cd->cache_request || cd->cache_parse) {
 		p = proc_create_data("channel", S_IFREG|S_IRUSR|S_IWUSR,
 				     cd->u.procfs.proc_ent,
 				     &cache_file_operations_procfs, cd);
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 6b03cc1..002ddd9 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -157,11 +157,6 @@ static void ip_map_request(struct cache_detail *cd,
 	(*bpp)[-1] = '\n';
 }
 
-static int ip_map_upcall(struct cache_detail *cd, struct cache_head *h)
-{
-	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
-}
-
 static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class, struct in6_addr *addr);
 static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm, struct unix_domain *udom, time_t expiry);
 
@@ -470,11 +465,6 @@ static void unix_gid_request(struct cache_detail *cd,
 	(*bpp)[-1] = '\n';
 }
 
-static int unix_gid_upcall(struct cache_detail *cd, struct cache_head *h)
-{
-	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
-}
-
 static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, uid_t uid);
 
 static int unix_gid_parse(struct cache_detail *cd,
@@ -577,7 +567,6 @@ static struct cache_detail unix_gid_cache_template = {
 	.hash_size	= GID_HASHMAX,
 	.name		= "auth.unix.gid",
 	.cache_put	= unix_gid_put,
-	.cache_upcall	= unix_gid_upcall,
 	.cache_request	= unix_gid_request,
 	.cache_parse	= unix_gid_parse,
 	.cache_show	= unix_gid_show,
@@ -875,7 +864,6 @@ static struct cache_detail ip_map_cache_template = {
 	.hash_size	= IP_HASHMAX,
 	.name		= "auth.unix.ip",
 	.cache_put	= ip_map_put,
-	.cache_upcall	= ip_map_upcall,
 	.cache_request	= ip_map_request,
 	.cache_parse	= ip_map_parse,
 	.cache_show	= ip_map_show,


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

* [PATCH 3/4] SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function
  2013-01-15  8:09 [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping Stanislav Kinsbursky
  2013-01-15  8:09 ` [PATCH 1/4] SUNRPC: introduce cache_detail->cache_request callback Stanislav Kinsbursky
  2013-01-15  8:09 ` [PATCH 2/4] SUNRPC: remove cache_detail->cache_upcall callback Stanislav Kinsbursky
@ 2013-01-15  8:09 ` Stanislav Kinsbursky
  2013-01-15  8:09 ` [PATCH 4/4] SUNRPC: move cache_detail->cache_request callback call to cache_read() Stanislav Kinsbursky
  2013-01-30 23:00 ` [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping J. Bruce Fields
  4 siblings, 0 replies; 11+ messages in thread
From: Stanislav Kinsbursky @ 2013-01-15  8:09 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Trond.Myklebust, linux-kernel, devel

Passing this pointer is redundant since it's stored on cache_detail structure,
which is also passed to sunrpc_cache_pipe_upcall () function.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
 fs/nfs/dns_resolve.c         |    2 +-
 include/linux/sunrpc/cache.h |    6 +-----
 net/sunrpc/cache.c           |   10 +++-------
 3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c
index 90edbd0..f5c4c35 100644
--- a/fs/nfs/dns_resolve.c
+++ b/fs/nfs/dns_resolve.c
@@ -142,7 +142,7 @@ static int nfs_dns_upcall(struct cache_detail *cd,
 
 	ret = nfs_cache_upcall(cd, key->hostname);
 	if (ret)
-		ret = sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
+		ret = sunrpc_cache_pipe_upcall(cd, ch);
 	return ret;
 }
 
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 249e73a..ea927ea 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -158,11 +158,7 @@ sunrpc_cache_update(struct cache_detail *detail,
 		    struct cache_head *new, struct cache_head *old, int hash);
 
 extern int
-sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h,
-		void (*cache_request)(struct cache_detail *,
-				      struct cache_head *,
-				      char **,
-				      int *));
+sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h);
 
 
 extern void cache_clean_deferred(void *owner);
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index ee6b5dd..901fdca 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -198,7 +198,7 @@ static int cache_make_upcall(struct cache_detail *cd, struct cache_head *h)
 {
 	if (!cd->cache_request)
 		return -EINVAL;
-	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
+	return sunrpc_cache_pipe_upcall(cd, h);
 }
 
 static inline int cache_is_valid(struct cache_detail *detail, struct cache_head *h)
@@ -1140,11 +1140,7 @@ static bool cache_listeners_exist(struct cache_detail *detail)
  *
  * Each request is at most one page long.
  */
-int sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h,
-		void (*cache_request)(struct cache_detail *,
-				      struct cache_head *,
-				      char **,
-				      int *))
+int sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h)
 {
 
 	char *buf;
@@ -1169,7 +1165,7 @@ int sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h,
 
 	bp = buf; len = PAGE_SIZE;
 
-	cache_request(detail, h, &bp, &len);
+	detail->cache_request(detail, h, &bp, &len);
 
 	if (len < 0) {
 		kfree(buf);


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

* [PATCH 4/4] SUNRPC: move cache_detail->cache_request callback call to cache_read()
  2013-01-15  8:09 [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping Stanislav Kinsbursky
                   ` (2 preceding siblings ...)
  2013-01-15  8:09 ` [PATCH 3/4] SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function Stanislav Kinsbursky
@ 2013-01-15  8:09 ` Stanislav Kinsbursky
  2013-01-30 23:00 ` [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping J. Bruce Fields
  4 siblings, 0 replies; 11+ messages in thread
From: Stanislav Kinsbursky @ 2013-01-15  8:09 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Trond.Myklebust, linux-kernel, devel

function

The reason to move cache_request() callback call from
sunrpc_cache_pipe_upcall() to cache_read() is that this garantees, that cache
access will be done userspace process context (only userspace process have
proper root context).
This is required for NFSd support in container: svc_export_request() (which is
cache_request callback) calls d_path(), which, in turn, traverse dentry up to
current->fs->root. Kernel threads always have global root, while container
have be in "root jail" - i.e. have it's own nested root.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
 net/sunrpc/cache.c |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 901fdca..55f044c 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -750,6 +750,18 @@ struct cache_reader {
 	int			offset;	/* if non-0, we have a refcnt on next request */
 };
 
+static int cache_request(struct cache_detail *detail,
+			       struct cache_request *crq)
+{
+	char *bp = crq->buf;
+	int len = PAGE_SIZE;
+
+	detail->cache_request(detail, crq->item, &bp, &len);
+	if (len < 0)
+		return -EAGAIN;
+	return PAGE_SIZE - len;
+}
+
 static ssize_t cache_read(struct file *filp, char __user *buf, size_t count,
 			  loff_t *ppos, struct cache_detail *cd)
 {
@@ -784,6 +796,13 @@ static ssize_t cache_read(struct file *filp, char __user *buf, size_t count,
 		rq->readers++;
 	spin_unlock(&queue_lock);
 
+	if (rq->len == 0) {
+		err = cache_request(cd, rq);
+		if (err < 0)
+			goto out;
+		rq->len = err;
+	}
+
 	if (rp->offset == 0 && !test_bit(CACHE_PENDING, &rq->item->flags)) {
 		err = -EAGAIN;
 		spin_lock(&queue_lock);
@@ -1145,8 +1164,6 @@ int sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h)
 
 	char *buf;
 	struct cache_request *crq;
-	char *bp;
-	int len;
 
 	if (!cache_listeners_exist(detail)) {
 		warn_no_listener(detail);
@@ -1163,19 +1180,10 @@ int sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h)
 		return -EAGAIN;
 	}
 
-	bp = buf; len = PAGE_SIZE;
-
-	detail->cache_request(detail, h, &bp, &len);
-
-	if (len < 0) {
-		kfree(buf);
-		kfree(crq);
-		return -EAGAIN;
-	}
 	crq->q.reader = 0;
 	crq->item = cache_get(h);
 	crq->buf = buf;
-	crq->len = PAGE_SIZE - len;
+	crq->len = 0;
 	crq->readers = 0;
 	spin_lock(&queue_lock);
 	list_add_tail(&crq->q.list, &detail->queue);


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

* Re: [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping
  2013-01-15  8:09 [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping Stanislav Kinsbursky
                   ` (3 preceding siblings ...)
  2013-01-15  8:09 ` [PATCH 4/4] SUNRPC: move cache_detail->cache_request callback call to cache_read() Stanislav Kinsbursky
@ 2013-01-30 23:00 ` J. Bruce Fields
  2013-01-31  5:15   ` Stanislav Kinsbursky
  2013-02-04 10:22   ` Stanislav Kinsbursky
  4 siblings, 2 replies; 11+ messages in thread
From: J. Bruce Fields @ 2013-01-30 23:00 UTC (permalink / raw)
  To: Stanislav Kinsbursky; +Cc: linux-nfs, Trond.Myklebust, linux-kernel, devel

On Tue, Jan 15, 2013 at 11:09:23AM +0300, Stanislav Kinsbursky wrote:
> 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.

Sorry for the delay.  This looks good to me--committing pending some
testing.

What's left now for basic containerized nfsd support?

--b.

> 
> The following series implements...
> 
> ---
> 
> Stanislav Kinsbursky (4):
>       SUNRPC: introduce cache_detail->cache_request callback
>       SUNRPC: remove cache_detail->cache_upcall callback
>       SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function
>       SUNRPC: move cache_detail->cache_request callback call to cache_read()
> 
> 
>  fs/nfs/dns_resolve.c              |    2 +-
>  fs/nfsd/export.c                  |   14 ++----------
>  fs/nfsd/nfs4idmap.c               |   16 ++-----------
>  include/linux/sunrpc/cache.h      |   11 +++------
>  net/sunrpc/auth_gss/svcauth_gss.c |    8 +------
>  net/sunrpc/cache.c                |   44 ++++++++++++++++++++-----------------
>  net/sunrpc/svcauth_unix.c         |   14 ++----------
>  7 files changed, 36 insertions(+), 73 deletions(-)
> 

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

* Re: [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping
  2013-01-30 23:00 ` [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping J. Bruce Fields
@ 2013-01-31  5:15   ` Stanislav Kinsbursky
  2013-02-04 10:22   ` Stanislav Kinsbursky
  1 sibling, 0 replies; 11+ messages in thread
From: Stanislav Kinsbursky @ 2013-01-31  5:15 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-nfs, Trond.Myklebust, linux-kernel, devel

31.01.2013 03:00, J. Bruce Fields пишет:
> On Tue, Jan 15, 2013 at 11:09:23AM +0300, Stanislav Kinsbursky wrote:
>> 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.
>
> Sorry for the delay.  This looks good to me--committing pending some
> testing.
>
> What's left now for basic containerized nfsd support?
>

Sure, thanks!
Not that many patches left: NFSd fs per-net (to get the proper context from the superblock), disabling UMH tracker for a while (again selecting proper root 
issue) and removing of error patch for state tracker in current net != &init_net.
They are simple so I'm going to re-send them soon. Just wanna work a bit more on per-net service shutdown first since it looks more urgent.


-- 
Best regards,
Stanislav Kinsbursky

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

* Re: [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping
  2013-01-30 23:00 ` [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping J. Bruce Fields
  2013-01-31  5:15   ` Stanislav Kinsbursky
@ 2013-02-04 10:22   ` Stanislav Kinsbursky
  1 sibling, 0 replies; 11+ messages in thread
From: Stanislav Kinsbursky @ 2013-02-04 10:22 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-nfs, Trond.Myklebust, linux-kernel, devel

Bruce, there is a nfs_dns_upcall, which is not just a wrapper around sunrpc_cache_pipe_upcall().
So, please, drop this series. I'll send another one to replace soon.
BTW, there will be two more cleanup patches in the series for NFS DNS cache part.

31.01.2013 03:00, J. Bruce Fields пишет:
> On Tue, Jan 15, 2013 at 11:09:23AM +0300, Stanislav Kinsbursky wrote:
>> 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.
>
> Sorry for the delay.  This looks good to me--committing pending some
> testing.
>
> What's left now for basic containerized nfsd support?
>
> --b.
>
>>
>> The following series implements...
>>
>> ---
>>
>> Stanislav Kinsbursky (4):
>>        SUNRPC: introduce cache_detail->cache_request callback
>>        SUNRPC: remove cache_detail->cache_upcall callback
>>        SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function
>>        SUNRPC: move cache_detail->cache_request callback call to cache_read()
>>
>>
>>   fs/nfs/dns_resolve.c              |    2 +-
>>   fs/nfsd/export.c                  |   14 ++----------
>>   fs/nfsd/nfs4idmap.c               |   16 ++-----------
>>   include/linux/sunrpc/cache.h      |   11 +++------
>>   net/sunrpc/auth_gss/svcauth_gss.c |    8 +------
>>   net/sunrpc/cache.c                |   44 ++++++++++++++++++++-----------------
>>   net/sunrpc/svcauth_unix.c         |   14 ++----------
>>   7 files changed, 36 insertions(+), 73 deletions(-)
>>


-- 
Best regards,
Stanislav Kinsbursky

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

* Re: [PATCH 2/4] SUNRPC: remove cache_detail->cache_upcall callback
  2013-01-15  8:09 ` [PATCH 2/4] SUNRPC: remove cache_detail->cache_upcall callback Stanislav Kinsbursky
@ 2013-02-04 16:50   ` Jeff Layton
  2013-02-04 17:15     ` J. Bruce Fields
  2013-02-05  5:37     ` Stanislav Kinsbursky
  0 siblings, 2 replies; 11+ messages in thread
From: Jeff Layton @ 2013-02-04 16:50 UTC (permalink / raw)
  To: Stanislav Kinsbursky
  Cc: bfields, linux-nfs, Trond.Myklebust, linux-kernel, devel

On Tue, 15 Jan 2013 11:09:36 +0300
Stanislav Kinsbursky <skinsbursky@parallels.com> wrote:

> This callback is redundant since all that its' implementations are doing is
> calling sunrpc_cache_pipe_upcall() with proper function address argument. This
> function address is now stored on cache_detail structure and thus all the code
> can be simplified.
> 
> Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
> ---
>  fs/nfsd/export.c                  |   12 ------------
>  fs/nfsd/nfs4idmap.c               |   14 --------------
>  include/linux/sunrpc/cache.h      |    3 ---
>  net/sunrpc/auth_gss/svcauth_gss.c |    7 -------
>  net/sunrpc/cache.c                |    6 +++---
>  net/sunrpc/svcauth_unix.c         |   12 ------------
>  6 files changed, 3 insertions(+), 51 deletions(-)
> 
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index 63ee3bc..6f030a5 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -67,11 +67,6 @@ static void expkey_request(struct cache_detail *cd,
>  	(*bpp)[-1] = '\n';
>  }
>  
> -static int expkey_upcall(struct cache_detail *cd, struct cache_head *h)
> -{
> -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
> -}
> -
>  static struct svc_expkey *svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new,
>  					    struct svc_expkey *old);
>  static struct svc_expkey *svc_expkey_lookup(struct cache_detail *cd, struct svc_expkey *);
> @@ -245,7 +240,6 @@ static struct cache_detail svc_expkey_cache_template = {
>  	.hash_size	= EXPKEY_HASHMAX,
>  	.name		= "nfsd.fh",
>  	.cache_put	= expkey_put,
> -	.cache_upcall	= expkey_upcall,
>  	.cache_request	= expkey_request,
>  	.cache_parse	= expkey_parse,
>  	.cache_show	= expkey_show,
> @@ -338,11 +332,6 @@ static void svc_export_request(struct cache_detail *cd,
>  	(*bpp)[-1] = '\n';
>  }
>  
> -static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h)
> -{
> -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
> -}
> -
>  static struct svc_export *svc_export_update(struct svc_export *new,
>  					    struct svc_export *old);
>  static struct svc_export *svc_export_lookup(struct svc_export *);
> @@ -712,7 +701,6 @@ static struct cache_detail svc_export_cache_template = {
>  	.hash_size	= EXPORT_HASHMAX,
>  	.name		= "nfsd.export",
>  	.cache_put	= svc_export_put,
> -	.cache_upcall	= svc_export_upcall,
>  	.cache_request	= svc_export_request,
>  	.cache_parse	= svc_export_parse,
>  	.cache_show	= svc_export_show,
> diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
> index 9033dfd..d9402ea 100644
> --- a/fs/nfsd/nfs4idmap.c
> +++ b/fs/nfsd/nfs4idmap.c
> @@ -140,12 +140,6 @@ idtoname_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
>  }
>  
>  static int
> -idtoname_upcall(struct cache_detail *cd, struct cache_head *ch)
> -{
> -	return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
> -}
> -
> -static int
>  idtoname_match(struct cache_head *ca, struct cache_head *cb)
>  {
>  	struct ent *a = container_of(ca, struct ent, h);
> @@ -192,7 +186,6 @@ static struct cache_detail idtoname_cache_template = {
>  	.hash_size	= ENT_HASHMAX,
>  	.name		= "nfs4.idtoname",
>  	.cache_put	= ent_put,
> -	.cache_upcall	= idtoname_upcall,
>  	.cache_request	= idtoname_request,
>  	.cache_parse	= idtoname_parse,
>  	.cache_show	= idtoname_show,
> @@ -322,12 +315,6 @@ nametoid_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
>  }
>  
>  static int
> -nametoid_upcall(struct cache_detail *cd, struct cache_head *ch)
> -{
> -	return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
> -}
> -
> -static int
>  nametoid_match(struct cache_head *ca, struct cache_head *cb)
>  {
>  	struct ent *a = container_of(ca, struct ent, h);
> @@ -366,7 +353,6 @@ static struct cache_detail nametoid_cache_template = {
>  	.hash_size	= ENT_HASHMAX,
>  	.name		= "nfs4.nametoid",
>  	.cache_put	= ent_put,
> -	.cache_upcall	= nametoid_upcall,
>  	.cache_request	= nametoid_request,
>  	.cache_parse	= nametoid_parse,
>  	.cache_show	= nametoid_show,
> diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
> index 4f1c858..249e73a 100644
> --- a/include/linux/sunrpc/cache.h
> +++ b/include/linux/sunrpc/cache.h
> @@ -80,9 +80,6 @@ struct cache_detail {
>  	char			*name;
>  	void			(*cache_put)(struct kref *);
>  
> -	int			(*cache_upcall)(struct cache_detail *,
> -						struct cache_head *);
> -
>  	void			(*cache_request)(struct cache_detail *cd,
>  						 struct cache_head *ch,
>  						 char **bpp, int *blen);
> diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
> index 82437f9..1bd18af 100644
> --- a/net/sunrpc/auth_gss/svcauth_gss.c
> +++ b/net/sunrpc/auth_gss/svcauth_gss.c
> @@ -182,12 +182,6 @@ static void rsi_request(struct cache_detail *cd,
>  	(*bpp)[-1] = '\n';
>  }
>  
> -static int rsi_upcall(struct cache_detail *cd, struct cache_head *h)
> -{
> -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
> -}
> -
> -
>  static int rsi_parse(struct cache_detail *cd,
>  		    char *mesg, int mlen)
>  {
> @@ -275,7 +269,6 @@ static struct cache_detail rsi_cache_template = {
>  	.hash_size	= RSI_HASHMAX,
>  	.name           = "auth.rpcsec.init",
>  	.cache_put      = rsi_put,
> -	.cache_upcall   = rsi_upcall,
>  	.cache_request  = rsi_request,
>  	.cache_parse    = rsi_parse,
>  	.match		= rsi_match,
> diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
> index fc2f7aa..ee6b5dd 100644
> --- a/net/sunrpc/cache.c
> +++ b/net/sunrpc/cache.c
> @@ -196,9 +196,9 @@ EXPORT_SYMBOL_GPL(sunrpc_cache_update);
>  
>  static int cache_make_upcall(struct cache_detail *cd, struct cache_head *h)
>  {
> -	if (!cd->cache_upcall)
> +	if (!cd->cache_request)
>  		return -EINVAL;
> -	return cd->cache_upcall(cd, h);
> +	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
>  }
>  
>  static inline int cache_is_valid(struct cache_detail *detail, struct cache_head *h)
> @@ -1605,7 +1605,7 @@ static int create_cache_proc_entries(struct cache_detail *cd, struct net *net)
>  	if (p == NULL)
>  		goto out_nomem;
>  
> -	if (cd->cache_upcall || cd->cache_parse) {
> +	if (cd->cache_request || cd->cache_parse) {
>  		p = proc_create_data("channel", S_IFREG|S_IRUSR|S_IWUSR,
>  				     cd->u.procfs.proc_ent,
>  				     &cache_file_operations_procfs, cd);
> diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
> index 6b03cc1..002ddd9 100644
> --- a/net/sunrpc/svcauth_unix.c
> +++ b/net/sunrpc/svcauth_unix.c
> @@ -157,11 +157,6 @@ static void ip_map_request(struct cache_detail *cd,
>  	(*bpp)[-1] = '\n';
>  }
>  
> -static int ip_map_upcall(struct cache_detail *cd, struct cache_head *h)
> -{
> -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
> -}
> -
>  static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class, struct in6_addr *addr);
>  static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm, struct unix_domain *udom, time_t expiry);
>  
> @@ -470,11 +465,6 @@ static void unix_gid_request(struct cache_detail *cd,
>  	(*bpp)[-1] = '\n';
>  }
>  
> -static int unix_gid_upcall(struct cache_detail *cd, struct cache_head *h)
> -{
> -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
> -}
> -
>  static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, uid_t uid);
>  
>  static int unix_gid_parse(struct cache_detail *cd,
> @@ -577,7 +567,6 @@ static struct cache_detail unix_gid_cache_template = {
>  	.hash_size	= GID_HASHMAX,
>  	.name		= "auth.unix.gid",
>  	.cache_put	= unix_gid_put,
> -	.cache_upcall	= unix_gid_upcall,
>  	.cache_request	= unix_gid_request,
>  	.cache_parse	= unix_gid_parse,
>  	.cache_show	= unix_gid_show,
> @@ -875,7 +864,6 @@ static struct cache_detail ip_map_cache_template = {
>  	.hash_size	= IP_HASHMAX,
>  	.name		= "auth.unix.ip",
>  	.cache_put	= ip_map_put,
> -	.cache_upcall	= ip_map_upcall,
>  	.cache_request	= ip_map_request,
>  	.cache_parse	= ip_map_parse,
>  	.cache_show	= ip_map_show,
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


I'm seeing a build break from this patch when CONFIG_NFS_USE_KERNEL_DNS
is not set:

  CC [M]  fs/nfs/dns_resolve.o
fs/nfs/dns_resolve.c: In function ‘nfs_dns_resolver_cache_init’:
fs/nfs/dns_resolve.c:377:4: error: ‘struct cache_detail’ has no member named ‘cache_upcall’
fs/nfs/dns_resolve.c:377:35: warning: left-hand operand of comma expression has no effect [-Wunused-value]
fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
fs/nfs/dns_resolve.c: At top level:
fs/nfs/dns_resolve.c:129:13: warning: ‘nfs_dns_request’ defined but not used [-Wunused-function]
make[1]: *** [fs/nfs/dns_resolve.o] Error 1
make: *** [_module_fs/nfs] Error 2

...looks like you need to convert that cache_detail to use your new
scheme as well?

-- 
Jeff Layton <jlayton@redhat.com>

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

* Re: [PATCH 2/4] SUNRPC: remove cache_detail->cache_upcall callback
  2013-02-04 16:50   ` Jeff Layton
@ 2013-02-04 17:15     ` J. Bruce Fields
  2013-02-05  5:37     ` Stanislav Kinsbursky
  1 sibling, 0 replies; 11+ messages in thread
From: J. Bruce Fields @ 2013-02-04 17:15 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Stanislav Kinsbursky, linux-nfs, Trond.Myklebust, linux-kernel,
	devel

On Mon, Feb 04, 2013 at 11:50:02AM -0500, Jeff Layton wrote:
> On Tue, 15 Jan 2013 11:09:36 +0300
> Stanislav Kinsbursky <skinsbursky@parallels.com> wrote:
> 
> > This callback is redundant since all that its' implementations are doing is
> > calling sunrpc_cache_pipe_upcall() with proper function address argument. This
> > function address is now stored on cache_detail structure and thus all the code
> > can be simplified.
> > 
> > Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
> > ---
> >  fs/nfsd/export.c                  |   12 ------------
> >  fs/nfsd/nfs4idmap.c               |   14 --------------
> >  include/linux/sunrpc/cache.h      |    3 ---
> >  net/sunrpc/auth_gss/svcauth_gss.c |    7 -------
> >  net/sunrpc/cache.c                |    6 +++---
> >  net/sunrpc/svcauth_unix.c         |   12 ------------
> >  6 files changed, 3 insertions(+), 51 deletions(-)
> > 
> > diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> > index 63ee3bc..6f030a5 100644
> > --- a/fs/nfsd/export.c
> > +++ b/fs/nfsd/export.c
> > @@ -67,11 +67,6 @@ static void expkey_request(struct cache_detail *cd,
> >  	(*bpp)[-1] = '\n';
> >  }
> >  
> > -static int expkey_upcall(struct cache_detail *cd, struct cache_head *h)
> > -{
> > -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
> > -}
> > -
> >  static struct svc_expkey *svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new,
> >  					    struct svc_expkey *old);
> >  static struct svc_expkey *svc_expkey_lookup(struct cache_detail *cd, struct svc_expkey *);
> > @@ -245,7 +240,6 @@ static struct cache_detail svc_expkey_cache_template = {
> >  	.hash_size	= EXPKEY_HASHMAX,
> >  	.name		= "nfsd.fh",
> >  	.cache_put	= expkey_put,
> > -	.cache_upcall	= expkey_upcall,
> >  	.cache_request	= expkey_request,
> >  	.cache_parse	= expkey_parse,
> >  	.cache_show	= expkey_show,
> > @@ -338,11 +332,6 @@ static void svc_export_request(struct cache_detail *cd,
> >  	(*bpp)[-1] = '\n';
> >  }
> >  
> > -static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h)
> > -{
> > -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
> > -}
> > -
> >  static struct svc_export *svc_export_update(struct svc_export *new,
> >  					    struct svc_export *old);
> >  static struct svc_export *svc_export_lookup(struct svc_export *);
> > @@ -712,7 +701,6 @@ static struct cache_detail svc_export_cache_template = {
> >  	.hash_size	= EXPORT_HASHMAX,
> >  	.name		= "nfsd.export",
> >  	.cache_put	= svc_export_put,
> > -	.cache_upcall	= svc_export_upcall,
> >  	.cache_request	= svc_export_request,
> >  	.cache_parse	= svc_export_parse,
> >  	.cache_show	= svc_export_show,
> > diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
> > index 9033dfd..d9402ea 100644
> > --- a/fs/nfsd/nfs4idmap.c
> > +++ b/fs/nfsd/nfs4idmap.c
> > @@ -140,12 +140,6 @@ idtoname_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
> >  }
> >  
> >  static int
> > -idtoname_upcall(struct cache_detail *cd, struct cache_head *ch)
> > -{
> > -	return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
> > -}
> > -
> > -static int
> >  idtoname_match(struct cache_head *ca, struct cache_head *cb)
> >  {
> >  	struct ent *a = container_of(ca, struct ent, h);
> > @@ -192,7 +186,6 @@ static struct cache_detail idtoname_cache_template = {
> >  	.hash_size	= ENT_HASHMAX,
> >  	.name		= "nfs4.idtoname",
> >  	.cache_put	= ent_put,
> > -	.cache_upcall	= idtoname_upcall,
> >  	.cache_request	= idtoname_request,
> >  	.cache_parse	= idtoname_parse,
> >  	.cache_show	= idtoname_show,
> > @@ -322,12 +315,6 @@ nametoid_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
> >  }
> >  
> >  static int
> > -nametoid_upcall(struct cache_detail *cd, struct cache_head *ch)
> > -{
> > -	return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
> > -}
> > -
> > -static int
> >  nametoid_match(struct cache_head *ca, struct cache_head *cb)
> >  {
> >  	struct ent *a = container_of(ca, struct ent, h);
> > @@ -366,7 +353,6 @@ static struct cache_detail nametoid_cache_template = {
> >  	.hash_size	= ENT_HASHMAX,
> >  	.name		= "nfs4.nametoid",
> >  	.cache_put	= ent_put,
> > -	.cache_upcall	= nametoid_upcall,
> >  	.cache_request	= nametoid_request,
> >  	.cache_parse	= nametoid_parse,
> >  	.cache_show	= nametoid_show,
> > diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
> > index 4f1c858..249e73a 100644
> > --- a/include/linux/sunrpc/cache.h
> > +++ b/include/linux/sunrpc/cache.h
> > @@ -80,9 +80,6 @@ struct cache_detail {
> >  	char			*name;
> >  	void			(*cache_put)(struct kref *);
> >  
> > -	int			(*cache_upcall)(struct cache_detail *,
> > -						struct cache_head *);
> > -
> >  	void			(*cache_request)(struct cache_detail *cd,
> >  						 struct cache_head *ch,
> >  						 char **bpp, int *blen);
> > diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
> > index 82437f9..1bd18af 100644
> > --- a/net/sunrpc/auth_gss/svcauth_gss.c
> > +++ b/net/sunrpc/auth_gss/svcauth_gss.c
> > @@ -182,12 +182,6 @@ static void rsi_request(struct cache_detail *cd,
> >  	(*bpp)[-1] = '\n';
> >  }
> >  
> > -static int rsi_upcall(struct cache_detail *cd, struct cache_head *h)
> > -{
> > -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
> > -}
> > -
> > -
> >  static int rsi_parse(struct cache_detail *cd,
> >  		    char *mesg, int mlen)
> >  {
> > @@ -275,7 +269,6 @@ static struct cache_detail rsi_cache_template = {
> >  	.hash_size	= RSI_HASHMAX,
> >  	.name           = "auth.rpcsec.init",
> >  	.cache_put      = rsi_put,
> > -	.cache_upcall   = rsi_upcall,
> >  	.cache_request  = rsi_request,
> >  	.cache_parse    = rsi_parse,
> >  	.match		= rsi_match,
> > diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
> > index fc2f7aa..ee6b5dd 100644
> > --- a/net/sunrpc/cache.c
> > +++ b/net/sunrpc/cache.c
> > @@ -196,9 +196,9 @@ EXPORT_SYMBOL_GPL(sunrpc_cache_update);
> >  
> >  static int cache_make_upcall(struct cache_detail *cd, struct cache_head *h)
> >  {
> > -	if (!cd->cache_upcall)
> > +	if (!cd->cache_request)
> >  		return -EINVAL;
> > -	return cd->cache_upcall(cd, h);
> > +	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
> >  }
> >  
> >  static inline int cache_is_valid(struct cache_detail *detail, struct cache_head *h)
> > @@ -1605,7 +1605,7 @@ static int create_cache_proc_entries(struct cache_detail *cd, struct net *net)
> >  	if (p == NULL)
> >  		goto out_nomem;
> >  
> > -	if (cd->cache_upcall || cd->cache_parse) {
> > +	if (cd->cache_request || cd->cache_parse) {
> >  		p = proc_create_data("channel", S_IFREG|S_IRUSR|S_IWUSR,
> >  				     cd->u.procfs.proc_ent,
> >  				     &cache_file_operations_procfs, cd);
> > diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
> > index 6b03cc1..002ddd9 100644
> > --- a/net/sunrpc/svcauth_unix.c
> > +++ b/net/sunrpc/svcauth_unix.c
> > @@ -157,11 +157,6 @@ static void ip_map_request(struct cache_detail *cd,
> >  	(*bpp)[-1] = '\n';
> >  }
> >  
> > -static int ip_map_upcall(struct cache_detail *cd, struct cache_head *h)
> > -{
> > -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
> > -}
> > -
> >  static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class, struct in6_addr *addr);
> >  static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm, struct unix_domain *udom, time_t expiry);
> >  
> > @@ -470,11 +465,6 @@ static void unix_gid_request(struct cache_detail *cd,
> >  	(*bpp)[-1] = '\n';
> >  }
> >  
> > -static int unix_gid_upcall(struct cache_detail *cd, struct cache_head *h)
> > -{
> > -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
> > -}
> > -
> >  static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, uid_t uid);
> >  
> >  static int unix_gid_parse(struct cache_detail *cd,
> > @@ -577,7 +567,6 @@ static struct cache_detail unix_gid_cache_template = {
> >  	.hash_size	= GID_HASHMAX,
> >  	.name		= "auth.unix.gid",
> >  	.cache_put	= unix_gid_put,
> > -	.cache_upcall	= unix_gid_upcall,
> >  	.cache_request	= unix_gid_request,
> >  	.cache_parse	= unix_gid_parse,
> >  	.cache_show	= unix_gid_show,
> > @@ -875,7 +864,6 @@ static struct cache_detail ip_map_cache_template = {
> >  	.hash_size	= IP_HASHMAX,
> >  	.name		= "auth.unix.ip",
> >  	.cache_put	= ip_map_put,
> > -	.cache_upcall	= ip_map_upcall,
> >  	.cache_request	= ip_map_request,
> >  	.cache_parse	= ip_map_parse,
> >  	.cache_show	= ip_map_show,
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> I'm seeing a build break from this patch when CONFIG_NFS_USE_KERNEL_DNS
> is not set:
> 
>   CC [M]  fs/nfs/dns_resolve.o
> fs/nfs/dns_resolve.c: In function ‘nfs_dns_resolver_cache_init’:
> fs/nfs/dns_resolve.c:377:4: error: ‘struct cache_detail’ has no member named ‘cache_upcall’
> fs/nfs/dns_resolve.c:377:35: warning: left-hand operand of comma expression has no effect [-Wunused-value]
> fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
> fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
> fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
> fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
> fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
> fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
> fs/nfs/dns_resolve.c: At top level:
> fs/nfs/dns_resolve.c:129:13: warning: ‘nfs_dns_request’ defined but not used [-Wunused-function]
> make[1]: *** [fs/nfs/dns_resolve.o] Error 1
> make: *** [_module_fs/nfs] Error 2
> 
> ...looks like you need to convert that cache_detail to use your new
> scheme as well?

Those patches are gone from my latest tree.  Stanislav has some
replacements that should get committed soon.

--b.

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

* Re: [PATCH 2/4] SUNRPC: remove cache_detail->cache_upcall callback
  2013-02-04 16:50   ` Jeff Layton
  2013-02-04 17:15     ` J. Bruce Fields
@ 2013-02-05  5:37     ` Stanislav Kinsbursky
  1 sibling, 0 replies; 11+ messages in thread
From: Stanislav Kinsbursky @ 2013-02-05  5:37 UTC (permalink / raw)
  To: Jeff Layton; +Cc: bfields, linux-nfs, Trond.Myklebust, linux-kernel, devel

04.02.2013 20:50, Jeff Layton пишет:
> On Tue, 15 Jan 2013 11:09:36 +0300
> Stanislav Kinsbursky <skinsbursky@parallels.com> wrote:
>
>> This callback is redundant since all that its' implementations are doing is
>> calling sunrpc_cache_pipe_upcall() with proper function address argument. This
>> function address is now stored on cache_detail structure and thus all the code
>> can be simplified.
>>
>> Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
>> ---
>>   fs/nfsd/export.c                  |   12 ------------
>>   fs/nfsd/nfs4idmap.c               |   14 --------------
>>   include/linux/sunrpc/cache.h      |    3 ---
>>   net/sunrpc/auth_gss/svcauth_gss.c |    7 -------
>>   net/sunrpc/cache.c                |    6 +++---
>>   net/sunrpc/svcauth_unix.c         |   12 ------------
>>   6 files changed, 3 insertions(+), 51 deletions(-)
>>
>> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
>> index 63ee3bc..6f030a5 100644
>> --- a/fs/nfsd/export.c
>> +++ b/fs/nfsd/export.c
>> @@ -67,11 +67,6 @@ static void expkey_request(struct cache_detail *cd,
>>   	(*bpp)[-1] = '\n';
>>   }
>>
>> -static int expkey_upcall(struct cache_detail *cd, struct cache_head *h)
>> -{
>> -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
>> -}
>> -
>>   static struct svc_expkey *svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new,
>>   					    struct svc_expkey *old);
>>   static struct svc_expkey *svc_expkey_lookup(struct cache_detail *cd, struct svc_expkey *);
>> @@ -245,7 +240,6 @@ static struct cache_detail svc_expkey_cache_template = {
>>   	.hash_size	= EXPKEY_HASHMAX,
>>   	.name		= "nfsd.fh",
>>   	.cache_put	= expkey_put,
>> -	.cache_upcall	= expkey_upcall,
>>   	.cache_request	= expkey_request,
>>   	.cache_parse	= expkey_parse,
>>   	.cache_show	= expkey_show,
>> @@ -338,11 +332,6 @@ static void svc_export_request(struct cache_detail *cd,
>>   	(*bpp)[-1] = '\n';
>>   }
>>
>> -static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h)
>> -{
>> -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
>> -}
>> -
>>   static struct svc_export *svc_export_update(struct svc_export *new,
>>   					    struct svc_export *old);
>>   static struct svc_export *svc_export_lookup(struct svc_export *);
>> @@ -712,7 +701,6 @@ static struct cache_detail svc_export_cache_template = {
>>   	.hash_size	= EXPORT_HASHMAX,
>>   	.name		= "nfsd.export",
>>   	.cache_put	= svc_export_put,
>> -	.cache_upcall	= svc_export_upcall,
>>   	.cache_request	= svc_export_request,
>>   	.cache_parse	= svc_export_parse,
>>   	.cache_show	= svc_export_show,
>> diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
>> index 9033dfd..d9402ea 100644
>> --- a/fs/nfsd/nfs4idmap.c
>> +++ b/fs/nfsd/nfs4idmap.c
>> @@ -140,12 +140,6 @@ idtoname_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
>>   }
>>
>>   static int
>> -idtoname_upcall(struct cache_detail *cd, struct cache_head *ch)
>> -{
>> -	return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
>> -}
>> -
>> -static int
>>   idtoname_match(struct cache_head *ca, struct cache_head *cb)
>>   {
>>   	struct ent *a = container_of(ca, struct ent, h);
>> @@ -192,7 +186,6 @@ static struct cache_detail idtoname_cache_template = {
>>   	.hash_size	= ENT_HASHMAX,
>>   	.name		= "nfs4.idtoname",
>>   	.cache_put	= ent_put,
>> -	.cache_upcall	= idtoname_upcall,
>>   	.cache_request	= idtoname_request,
>>   	.cache_parse	= idtoname_parse,
>>   	.cache_show	= idtoname_show,
>> @@ -322,12 +315,6 @@ nametoid_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
>>   }
>>
>>   static int
>> -nametoid_upcall(struct cache_detail *cd, struct cache_head *ch)
>> -{
>> -	return sunrpc_cache_pipe_upcall(cd, ch, cd->cache_request);
>> -}
>> -
>> -static int
>>   nametoid_match(struct cache_head *ca, struct cache_head *cb)
>>   {
>>   	struct ent *a = container_of(ca, struct ent, h);
>> @@ -366,7 +353,6 @@ static struct cache_detail nametoid_cache_template = {
>>   	.hash_size	= ENT_HASHMAX,
>>   	.name		= "nfs4.nametoid",
>>   	.cache_put	= ent_put,
>> -	.cache_upcall	= nametoid_upcall,
>>   	.cache_request	= nametoid_request,
>>   	.cache_parse	= nametoid_parse,
>>   	.cache_show	= nametoid_show,
>> diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
>> index 4f1c858..249e73a 100644
>> --- a/include/linux/sunrpc/cache.h
>> +++ b/include/linux/sunrpc/cache.h
>> @@ -80,9 +80,6 @@ struct cache_detail {
>>   	char			*name;
>>   	void			(*cache_put)(struct kref *);
>>
>> -	int			(*cache_upcall)(struct cache_detail *,
>> -						struct cache_head *);
>> -
>>   	void			(*cache_request)(struct cache_detail *cd,
>>   						 struct cache_head *ch,
>>   						 char **bpp, int *blen);
>> diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
>> index 82437f9..1bd18af 100644
>> --- a/net/sunrpc/auth_gss/svcauth_gss.c
>> +++ b/net/sunrpc/auth_gss/svcauth_gss.c
>> @@ -182,12 +182,6 @@ static void rsi_request(struct cache_detail *cd,
>>   	(*bpp)[-1] = '\n';
>>   }
>>
>> -static int rsi_upcall(struct cache_detail *cd, struct cache_head *h)
>> -{
>> -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
>> -}
>> -
>> -
>>   static int rsi_parse(struct cache_detail *cd,
>>   		    char *mesg, int mlen)
>>   {
>> @@ -275,7 +269,6 @@ static struct cache_detail rsi_cache_template = {
>>   	.hash_size	= RSI_HASHMAX,
>>   	.name           = "auth.rpcsec.init",
>>   	.cache_put      = rsi_put,
>> -	.cache_upcall   = rsi_upcall,
>>   	.cache_request  = rsi_request,
>>   	.cache_parse    = rsi_parse,
>>   	.match		= rsi_match,
>> diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
>> index fc2f7aa..ee6b5dd 100644
>> --- a/net/sunrpc/cache.c
>> +++ b/net/sunrpc/cache.c
>> @@ -196,9 +196,9 @@ EXPORT_SYMBOL_GPL(sunrpc_cache_update);
>>
>>   static int cache_make_upcall(struct cache_detail *cd, struct cache_head *h)
>>   {
>> -	if (!cd->cache_upcall)
>> +	if (!cd->cache_request)
>>   		return -EINVAL;
>> -	return cd->cache_upcall(cd, h);
>> +	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
>>   }
>>
>>   static inline int cache_is_valid(struct cache_detail *detail, struct cache_head *h)
>> @@ -1605,7 +1605,7 @@ static int create_cache_proc_entries(struct cache_detail *cd, struct net *net)
>>   	if (p == NULL)
>>   		goto out_nomem;
>>
>> -	if (cd->cache_upcall || cd->cache_parse) {
>> +	if (cd->cache_request || cd->cache_parse) {
>>   		p = proc_create_data("channel", S_IFREG|S_IRUSR|S_IWUSR,
>>   				     cd->u.procfs.proc_ent,
>>   				     &cache_file_operations_procfs, cd);
>> diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
>> index 6b03cc1..002ddd9 100644
>> --- a/net/sunrpc/svcauth_unix.c
>> +++ b/net/sunrpc/svcauth_unix.c
>> @@ -157,11 +157,6 @@ static void ip_map_request(struct cache_detail *cd,
>>   	(*bpp)[-1] = '\n';
>>   }
>>
>> -static int ip_map_upcall(struct cache_detail *cd, struct cache_head *h)
>> -{
>> -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
>> -}
>> -
>>   static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class, struct in6_addr *addr);
>>   static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm, struct unix_domain *udom, time_t expiry);
>>
>> @@ -470,11 +465,6 @@ static void unix_gid_request(struct cache_detail *cd,
>>   	(*bpp)[-1] = '\n';
>>   }
>>
>> -static int unix_gid_upcall(struct cache_detail *cd, struct cache_head *h)
>> -{
>> -	return sunrpc_cache_pipe_upcall(cd, h, cd->cache_request);
>> -}
>> -
>>   static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, uid_t uid);
>>
>>   static int unix_gid_parse(struct cache_detail *cd,
>> @@ -577,7 +567,6 @@ static struct cache_detail unix_gid_cache_template = {
>>   	.hash_size	= GID_HASHMAX,
>>   	.name		= "auth.unix.gid",
>>   	.cache_put	= unix_gid_put,
>> -	.cache_upcall	= unix_gid_upcall,
>>   	.cache_request	= unix_gid_request,
>>   	.cache_parse	= unix_gid_parse,
>>   	.cache_show	= unix_gid_show,
>> @@ -875,7 +864,6 @@ static struct cache_detail ip_map_cache_template = {
>>   	.hash_size	= IP_HASHMAX,
>>   	.name		= "auth.unix.ip",
>>   	.cache_put	= ip_map_put,
>> -	.cache_upcall	= ip_map_upcall,
>>   	.cache_request	= ip_map_request,
>>   	.cache_parse	= ip_map_parse,
>>   	.cache_show	= ip_map_show,
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
> I'm seeing a build break from this patch when CONFIG_NFS_USE_KERNEL_DNS
> is not set:
>
>    CC [M]  fs/nfs/dns_resolve.o
> fs/nfs/dns_resolve.c: In function ‘nfs_dns_resolver_cache_init’:
> fs/nfs/dns_resolve.c:377:4: error: ‘struct cache_detail’ has no member named ‘cache_upcall’
> fs/nfs/dns_resolve.c:377:35: warning: left-hand operand of comma expression has no effect [-Wunused-value]
> fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
> fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
> fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
> fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
> fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
> fs/nfs/dns_resolve.c:377:35: warning: value computed is not used [-Wunused-value]
> fs/nfs/dns_resolve.c: At top level:
> fs/nfs/dns_resolve.c:129:13: warning: ‘nfs_dns_request’ defined but not used [-Wunused-function]
> make[1]: *** [fs/nfs/dns_resolve.o] Error 1
> make: *** [_module_fs/nfs] Error 2
>
> ...looks like you need to convert that cache_detail to use your new
> scheme as well?
>

Yes, thanks, Jeff!
Have a look at the second version of this series.

-- 
Best regards,
Stanislav Kinsbursky

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

end of thread, other threads:[~2013-02-05  5:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15  8:09 [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping Stanislav Kinsbursky
2013-01-15  8:09 ` [PATCH 1/4] SUNRPC: introduce cache_detail->cache_request callback Stanislav Kinsbursky
2013-01-15  8:09 ` [PATCH 2/4] SUNRPC: remove cache_detail->cache_upcall callback Stanislav Kinsbursky
2013-02-04 16:50   ` Jeff Layton
2013-02-04 17:15     ` J. Bruce Fields
2013-02-05  5:37     ` Stanislav Kinsbursky
2013-01-15  8:09 ` [PATCH 3/4] SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function Stanislav Kinsbursky
2013-01-15  8:09 ` [PATCH 4/4] SUNRPC: move cache_detail->cache_request callback call to cache_read() Stanislav Kinsbursky
2013-01-30 23:00 ` [RFC PATCH 0/4] SUNRPC: rework cache upcall to avoid NFSd root swapping J. Bruce Fields
2013-01-31  5:15   ` Stanislav Kinsbursky
2013-02-04 10:22   ` Stanislav Kinsbursky

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