Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39987
b: refs/heads/master
c: cc45f01
h: refs/heads/master
i:
  39985: b4f7c68
  39983: 9ea56d8
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Oct 20, 2006
1 parent d120581 commit 3c5f385
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b7766da7f7395b74dec9e52005b7dac0d09391a4
refs/heads/master: cc45f0175088e000ac7493e5e3f05579b6f7d240
21 changes: 11 additions & 10 deletions trunk/fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1292,24 +1292,24 @@ static int nfsd4_encode_fs_location4(struct nfsd4_fs_location *location,
* Returned string is safe to use as long as the caller holds a reference
* to @exp.
*/
static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp)
static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp, u32 *stat)
{
struct svc_fh tmp_fh;
char *path, *rootpath;
int stat;

fh_init(&tmp_fh, NFS4_FHSIZE);
stat = exp_pseudoroot(rqstp->rq_client, &tmp_fh, &rqstp->rq_chandle);
if (stat)
return ERR_PTR(stat);
*stat = exp_pseudoroot(rqstp->rq_client, &tmp_fh, &rqstp->rq_chandle);
if (*stat)
return NULL;
rootpath = tmp_fh.fh_export->ex_path;

path = exp->ex_path;

if (strncmp(path, rootpath, strlen(rootpath))) {
printk("nfsd: fs_locations failed;"
"%s is not contained in %s\n", path, rootpath);
return ERR_PTR(-EOPNOTSUPP);
*stat = nfserr_notsupp;
return NULL;
}

return path + strlen(rootpath);
Expand All @@ -1322,13 +1322,14 @@ static int nfsd4_encode_fs_locations(struct svc_rqst *rqstp,
struct svc_export *exp,
u32 **pp, int *buflen)
{
int status, i;
u32 status;
int i;
u32 *p = *pp;
struct nfsd4_fs_locations *fslocs = &exp->ex_fslocs;
char *root = nfsd4_path(rqstp, exp);
char *root = nfsd4_path(rqstp, exp, &status);

if (IS_ERR(root))
return PTR_ERR(root);
if (status)
return status;
status = nfsd4_encode_components('/', root, &p, buflen);
if (status)
return status;
Expand Down

0 comments on commit 3c5f385

Please sign in to comment.