]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NFSv4.1: Ensure that layoutreturn uses the correct credential
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 20 May 2013 14:43:47 +0000 (10:43 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 20 May 2013 18:20:15 +0000 (14:20 -0400)
We need to use the same credential as was used for the layoutget
and/or layoutcommit operations.

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

index 045dc3e1dbeb5465eaec10da9fa460005eb3b6d8..01e8aea0a94f8466cb3b4cccf0ca477b65e42b2e 100644 (file)
@@ -6452,6 +6452,7 @@ int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp)
                .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTRETURN],
                .rpc_argp = &lrp->args,
                .rpc_resp = &lrp->res,
+               .rpc_cred = lrp->cred,
        };
        struct rpc_task_setup task_setup_data = {
                .rpc_client = lrp->clp->cl_rpcclient,
index 2f86115e6ad0f57b615246f6bfb2995172f89f79..89ca75f25721344d6e1bc4902e221dca0348afd4 100644 (file)
@@ -861,6 +861,7 @@ _pnfs_return_layout(struct inode *ino)
        lrp->args.inode = ino;
        lrp->args.layout = lo;
        lrp->clp = NFS_SERVER(ino)->nfs_client;
+       lrp->cred = lo->plh_lc_cred;
 
        status = nfs4_proc_layoutreturn(lrp);
 out: