NFS: Allow the NFS generic code to pass in a verifier to readdir

If we're ever going to allow support for servers that use the readdir
verifier, then that use needs to be managed by the middle layers as
those need to be able to reject cookies from other verifiers.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Tested-by: Benjamin Coddington <bcodding@redhat.com>
Tested-by: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
Trond Myklebust
2020-11-02 17:34:23 -05:00
parent 6c981eff23
commit 82e22a5e62
5 changed files with 76 additions and 53 deletions

View File

@@ -750,6 +750,20 @@ struct nfs_entry {
struct nfs_server * server;
};
struct nfs_readdir_arg {
struct dentry *dentry;
const struct cred *cred;
__be32 *verf;
u64 cookie;
struct page **pages;
unsigned int page_len;
bool plus;
};
struct nfs_readdir_res {
__be32 *verf;
};
/*
* The following types are for NFSv2 only.
*/
@@ -1744,8 +1758,7 @@ struct nfs_rpc_ops {
unsigned int, struct iattr *);
int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
int (*rmdir) (struct inode *, const struct qstr *);
int (*readdir) (struct dentry *, const struct cred *,
u64, struct page **, unsigned int, bool);
int (*readdir) (struct nfs_readdir_arg *, struct nfs_readdir_res *);
int (*mknod) (struct inode *, struct dentry *, struct iattr *,
dev_t);
int (*statfs) (struct nfs_server *, struct nfs_fh *,