nfsd: use nfs client rpc callback program
authorBenny Halevy <bhalevy@panasas.com>
Sun, 28 Sep 2008 06:21:26 +0000 (09:21 +0300)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Mon, 29 Sep 2008 22:13:40 +0000 (18:13 -0400)
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).

This patches introduces rpc_create_args.prognumber that allows
overriding program->number when creating rpc_clnt.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfs4callback.c
include/linux/sunrpc/clnt.h
net/sunrpc/clnt.c

index f7c793a5b803e5166d17e3dc8e7fc8672e1003cd..094747a1227c18b6ace1726d81ed97487c98169a 100644 (file)
@@ -380,6 +380,7 @@ static int do_probe_callback(void *data)
                .addrsize       = sizeof(addr),
                .timeout        = &timeparms,
                .program        = &cb_program,
+               .prognumber     = cb->cb_prog,
                .version        = nfs_cb_version[1]->number,
                .authflavor     = RPC_AUTH_UNIX, /* XXX: need AUTH_GSS... */
                .flags          = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET),
index 8ac8e75243a7c2cde46ca5198fab9d740e5b81fa..6f0ee1b84a4f5f64903f4c74af1004381c3d9dd1 100644 (file)
@@ -104,6 +104,7 @@ struct rpc_create_args {
        const struct rpc_timeout *timeout;
        char                    *servername;
        struct rpc_program      *program;
+       u32                     prognumber;     /* overrides program->number */
        u32                     version;
        rpc_authflavor_t        authflavor;
        unsigned long           flags;
index 76739e928d0da5ff99b748ac61538e2bfc03fbf4..da0789fa1b88876e785e2f8c233fd8f2f3950dbd 100644 (file)
@@ -174,7 +174,7 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, stru
        clnt->cl_procinfo = version->procs;
        clnt->cl_maxproc  = version->nrprocs;
        clnt->cl_protname = program->name;
-       clnt->cl_prog     = program->number;
+       clnt->cl_prog     = args->prognumber ? : program->number;
        clnt->cl_vers     = version->number;
        clnt->cl_stats    = program->stats;
        clnt->cl_metrics  = rpc_alloc_iostats(clnt);