]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NFSv4.1: Ensure that layoutget is called using the layout credential
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 20 May 2013 14:49:34 +0000 (10:49 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 20 May 2013 18:20:15 +0000 (14:20 -0400)
Ensure that we use the same credential for layoutget, layoutcommit and
layoutreturn.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4proc.c
fs/nfs/pnfs.c
include/linux/nfs_xdr.h

index 4e2fe714d5c292ae7776cb070c0c21fbfffdf7d1..045dc3e1dbeb5465eaec10da9fa460005eb3b6d8 100644 (file)
@@ -6348,6 +6348,7 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, gfp_t gfp_flags)
                .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTGET],
                .rpc_argp = &lgp->args,
                .rpc_resp = &lgp->res,
+               .rpc_cred = lgp->cred,
        };
        struct rpc_task_setup task_setup_data = {
                .rpc_client = server->client,
index c5bd758e563768d76b2a43c830dcba8b53e175cf..2f86115e6ad0f57b615246f6bfb2995172f89f79 100644 (file)
@@ -766,6 +766,7 @@ send_layoutget(struct pnfs_layout_hdr *lo,
        lgp->args.inode = ino;
        lgp->args.ctx = get_nfs_open_context(ctx);
        lgp->gfp_flags = gfp_flags;
+       lgp->cred = lo->plh_lc_cred;
 
        /* Synchronously retrieve layout information from server and
         * store in lseg.
index 104b62f23ee025a51d730228e061ea49ce4513e0..32c95d64e3aa865a64e467b26fe194fd58c547a8 100644 (file)
@@ -246,6 +246,7 @@ struct nfs4_layoutget_res {
 struct nfs4_layoutget {
        struct nfs4_layoutget_args args;
        struct nfs4_layoutget_res res;
+       struct rpc_cred *cred;
        gfp_t gfp_flags;
 };