Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] nfsd: use nfs client rpc callback program
@ 2008-09-17 19:43 Benny Halevy
  2008-09-17 23:10 ` J. Bruce Fields
  0 siblings, 1 reply; 27+ messages in thread
From: Benny Halevy @ 2008-09-17 19:43 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Olga Kornievskaia, linux-nfs, pnfs mailing list

From: Benny Halevy <bhalevy@panasas.com>

since commit ff7d9756b501744540be65e172d27ee321d86103
"nfsd: use static memory for callback program and stats"
do_probe_callback uses a static callback program
(NFS4_CALLBACK) rather than the one set in clp->cl_callback.cb_prog
as passed in by the client in setclientid (4.0)
or create_session (4.1).

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
 fs/nfsd/nfs4callback.c |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 30d3130..f555178 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -342,21 +342,6 @@ static struct rpc_version *	nfs_cb_version[] = {
 	&nfs_cb_version4,
 };
 
-static struct rpc_program cb_program;
-
-static struct rpc_stat cb_stats = {
-		.program	= &cb_program
-};
-
-#define NFS4_CALLBACK 0x40000000
-static struct rpc_program cb_program = {
-		.name 		= "nfs4_cb",
-		.number		= NFS4_CALLBACK,
-		.nrvers		= ARRAY_SIZE(nfs_cb_version),
-		.version	= nfs_cb_version,
-		.stats		= &cb_stats,
-};
-
 /* Reference counting, callback cleanup, etc., all look racy as heck.
  * And why is cb_set an atomic? */
 
@@ -371,6 +356,8 @@ static int do_probe_callback(void *data)
 		.to_maxval	= (NFSD_LEASE_TIME/2) * HZ,
 		.to_exponential	= 1,
 	};
+	static struct rpc_stat	cb_stats;
+	struct rpc_program	cb_program;
 	struct rpc_create_args args = {
 		.protocol	= IPPROTO_TCP,
 		.address	= (struct sockaddr *)&addr,
@@ -394,6 +381,20 @@ static int do_probe_callback(void *data)
 	addr.sin_port = htons(cb->cb_port);
 	addr.sin_addr.s_addr = htonl(cb->cb_addr);
 
+	/* Initialize rpc_program */
+	memset(&cb_program, 0, sizeof(cb_program));
+	cb_program.name = "nfs4_cb";
+	cb_program.number = clp->cl_callback.cb_prog;
+	cb_program.nrvers = ARRAY_SIZE(nfs_cb_version);
+	cb_program.version = nfs_cb_version;
+	cb_program.stats = &cb_stats;
+	memset(&cb_stats, 0, sizeof(cb_stats));
+	cb_stats.program = &cb_program;
+
+	dprintk("%s: program %s 0x%x nrvers %u version %u\n",
+		__func__, args.program->name, args.program->number,
+		args.program->nrvers, args.version);
+
 	/* Initialize rpc_stat */
 	memset(args.program->stats, 0, sizeof(struct rpc_stat));
 
-- 
1.6.0.1


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

end of thread, other threads:[~2008-09-29 19:21 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-17 19:43 [PATCH] nfsd: use nfs client rpc callback program Benny Halevy
2008-09-17 23:10 ` J. Bruce Fields
2008-09-17 23:34   ` Benny Halevy
2008-09-18  0:10     ` [pnfs] " Benny Halevy
2008-09-18 19:24       ` Benny Halevy
2008-09-18 19:43         ` Peter Staubach
2008-09-18 20:05           ` Benny Halevy
2008-09-18 21:36             ` Benny Halevy
2008-09-24 16:35         ` J. Bruce Fields
2008-09-24 16:59           ` Trond Myklebust
2008-09-24 17:21             ` J. Bruce Fields
2008-09-24 17:26               ` Trond Myklebust
2008-09-24 17:42                 ` J. Bruce Fields
2008-09-24 18:42                   ` Trond Myklebust
2008-09-24 18:49                     ` J. Bruce Fields
2008-09-25 19:30                       ` Benny Halevy
2008-09-25 20:00                         ` J. Bruce Fields
2008-09-25 20:27                           ` Trond Myklebust
2008-09-25 20:41                             ` J. Bruce Fields
2008-09-26 11:52                               ` Benny Halevy
2008-09-27  3:34                                 ` J. Bruce Fields
2008-09-28  6:21                                   ` [PATCH v4] " Benny Halevy
2008-09-29 19:21                                     ` J. Bruce Fields
2008-09-25 20:08                         ` [pnfs] [PATCH] " Trond Myklebust
2008-09-25 20:38                           ` J. Bruce Fields
2008-09-19 19:51     ` Olga Kornievskaia
2008-09-19 21:15       ` Benny Halevy

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