Commit ecdb3063 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] kNFSd: Allow request for nfsv4 pseudo root to perform an upcall.

Most cache-lookups to find export information will cause
an upcall, but currently the lookup to find the pseudo root
for nfsv4 wont asthe  cache-handle isn't made available.
This patch makes it available and makes sure that if the
upcall is made, the request is dropped (for now).
parent 448d25b8
...@@ -848,12 +848,18 @@ exp_rootfh(svc_client *clp, char *path, struct knfsd_fh *f, int maxsize) ...@@ -848,12 +848,18 @@ exp_rootfh(svc_client *clp, char *path, struct knfsd_fh *f, int maxsize)
* export point with fsid==0 * export point with fsid==0
*/ */
int int
exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp) exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp,
struct cache_req *creq)
{ {
struct svc_expkey *fsid_key; struct svc_expkey *fsid_key;
int rv; int rv;
u32 fsidv[2];
mk_fsid_v1(fsidv, 0);
fsid_key = exp_get_fsid_key(clp, 0); fsid_key = exp_find_key(clp, 1, fsidv, creq);
if (IS_ERR(fsid_key) && PTR_ERR(fsid_key) == -EAGAIN)
return nfserr_dropit;
if (!fsid_key || IS_ERR(fsid_key)) if (!fsid_key || IS_ERR(fsid_key))
return nfserr_perm; return nfserr_perm;
......
...@@ -179,7 +179,8 @@ static inline int ...@@ -179,7 +179,8 @@ static inline int
nfsd4_putrootfh(struct svc_rqst *rqstp, struct svc_fh *current_fh) nfsd4_putrootfh(struct svc_rqst *rqstp, struct svc_fh *current_fh)
{ {
fh_put(current_fh); fh_put(current_fh);
return exp_pseudoroot(rqstp->rq_client, current_fh); return exp_pseudoroot(rqstp->rq_client, current_fh,
&rqstp->rq_chandle);
} }
static inline int static inline int
......
...@@ -100,7 +100,7 @@ struct svc_export * exp_parent(struct auth_domain *clp, ...@@ -100,7 +100,7 @@ struct svc_export * exp_parent(struct auth_domain *clp,
struct cache_req *reqp); struct cache_req *reqp);
int exp_rootfh(struct auth_domain *, int exp_rootfh(struct auth_domain *,
char *path, struct knfsd_fh *, int maxsize); char *path, struct knfsd_fh *, int maxsize);
int exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp); int exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq);
int nfserrno(int errno); int nfserrno(int errno);
extern void expkey_put(struct cache_head *item, struct cache_detail *cd); extern void expkey_put(struct cache_head *item, struct cache_detail *cd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment