summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index bf97331c02d3..80cedb007c3c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4699,7 +4699,7 @@ static int nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
4699 return err; 4699 return err;
4700} 4700}
4701 4701
4702static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 4702static int _nfs4_proc_readdir(struct dentry *dentry, const struct cred *cred,
4703 u64 cookie, struct page **pages, unsigned int count, bool plus) 4703 u64 cookie, struct page **pages, unsigned int count, bool plus)
4704{ 4704{
4705 struct inode *dir = d_inode(dentry); 4705 struct inode *dir = d_inode(dentry);
@@ -4712,17 +4712,23 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
4712 .plus = plus, 4712 .plus = plus,
4713 }; 4713 };
4714 struct nfs4_readdir_res res; 4714 struct nfs4_readdir_res res;
4715 struct auth_cred acred = {
4716 .cred = cred,
4717 };
4715 struct rpc_message msg = { 4718 struct rpc_message msg = {
4716 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READDIR], 4719 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READDIR],
4717 .rpc_argp = &args, 4720 .rpc_argp = &args,
4718 .rpc_resp = &res, 4721 .rpc_resp = &res,
4719 .rpc_cred = cred, 4722 .rpc_cred = rpc_lookup_generic_cred(&acred,
4723 0, GFP_NOFS),
4720 }; 4724 };
4721 int status; 4725 int status;
4722 4726
4723 dprintk("%s: dentry = %pd2, cookie = %Lu\n", __func__, 4727 dprintk("%s: dentry = %pd2, cookie = %Lu\n", __func__,
4724 dentry, 4728 dentry,
4725 (unsigned long long)cookie); 4729 (unsigned long long)cookie);
4730 if (!msg.rpc_cred)
4731 return -ENOMEM;
4726 nfs4_setup_readdir(cookie, NFS_I(dir)->cookieverf, dentry, &args); 4732 nfs4_setup_readdir(cookie, NFS_I(dir)->cookieverf, dentry, &args);
4727 res.pgbase = args.pgbase; 4733 res.pgbase = args.pgbase;
4728 status = nfs4_call_sync(NFS_SERVER(dir)->client, NFS_SERVER(dir), &msg, &args.seq_args, &res.seq_res, 0); 4734 status = nfs4_call_sync(NFS_SERVER(dir)->client, NFS_SERVER(dir), &msg, &args.seq_args, &res.seq_res, 0);
@@ -4733,11 +4739,12 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
4733 4739
4734 nfs_invalidate_atime(dir); 4740 nfs_invalidate_atime(dir);
4735 4741
4742 put_rpccred(msg.rpc_cred);
4736 dprintk("%s: returns %d\n", __func__, status); 4743 dprintk("%s: returns %d\n", __func__, status);
4737 return status; 4744 return status;
4738} 4745}
4739 4746
4740static int nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 4747static int nfs4_proc_readdir(struct dentry *dentry, const struct cred *cred,
4741 u64 cookie, struct page **pages, unsigned int count, bool plus) 4748 u64 cookie, struct page **pages, unsigned int count, bool plus)
4742{ 4749{
4743 struct nfs4_exception exception = { }; 4750 struct nfs4_exception exception = { };