diff options
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/export.c | 22 | ||||
-rw-r--r-- | fs/nfsd/nfsproc.c | 1 |
2 files changed, 19 insertions, 4 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index c1c9e035d4a4..b73baba3fb97 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -1320,6 +1320,23 @@ rqst_exp_parent(struct svc_rqst *rqstp, struct path *path) | |||
1320 | return exp; | 1320 | return exp; |
1321 | } | 1321 | } |
1322 | 1322 | ||
1323 | static struct svc_export *find_fsidzero_export(struct svc_rqst *rqstp) | ||
1324 | { | ||
1325 | struct svc_export *exp; | ||
1326 | u32 fsidv[2]; | ||
1327 | |||
1328 | mk_fsid(FSID_NUM, fsidv, 0, 0, 0, NULL); | ||
1329 | |||
1330 | exp = rqst_exp_find(rqstp, FSID_NUM, fsidv); | ||
1331 | /* | ||
1332 | * We shouldn't have accepting an nfsv4 request at all if we | ||
1333 | * don't have a pseudoexport!: | ||
1334 | */ | ||
1335 | if (IS_ERR(exp) && PTR_ERR(exp) == -ENOENT) | ||
1336 | exp = ERR_PTR(-ESERVERFAULT); | ||
1337 | return exp; | ||
1338 | } | ||
1339 | |||
1323 | /* | 1340 | /* |
1324 | * Called when we need the filehandle for the root of the pseudofs, | 1341 | * Called when we need the filehandle for the root of the pseudofs, |
1325 | * for a given NFSv4 client. The root is defined to be the | 1342 | * for a given NFSv4 client. The root is defined to be the |
@@ -1330,11 +1347,8 @@ exp_pseudoroot(struct svc_rqst *rqstp, struct svc_fh *fhp) | |||
1330 | { | 1347 | { |
1331 | struct svc_export *exp; | 1348 | struct svc_export *exp; |
1332 | __be32 rv; | 1349 | __be32 rv; |
1333 | u32 fsidv[2]; | ||
1334 | |||
1335 | mk_fsid(FSID_NUM, fsidv, 0, 0, 0, NULL); | ||
1336 | 1350 | ||
1337 | exp = rqst_exp_find(rqstp, FSID_NUM, fsidv); | 1351 | exp = find_fsidzero_export(rqstp); |
1338 | if (IS_ERR(exp)) | 1352 | if (IS_ERR(exp)) |
1339 | return nfserrno(PTR_ERR(exp)); | 1353 | return nfserrno(PTR_ERR(exp)); |
1340 | rv = fh_compose(fhp, exp, exp->ex_path.dentry, NULL); | 1354 | rv = fh_compose(fhp, exp, exp->ex_path.dentry, NULL); |
diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c index 0eb9c820b7a6..c5393d1b8955 100644 --- a/fs/nfsd/nfsproc.c +++ b/fs/nfsd/nfsproc.c | |||
@@ -758,6 +758,7 @@ nfserrno (int errno) | |||
758 | { nfserr_io, -ETXTBSY }, | 758 | { nfserr_io, -ETXTBSY }, |
759 | { nfserr_notsupp, -EOPNOTSUPP }, | 759 | { nfserr_notsupp, -EOPNOTSUPP }, |
760 | { nfserr_toosmall, -ETOOSMALL }, | 760 | { nfserr_toosmall, -ETOOSMALL }, |
761 | { nfserr_serverfault, -ESERVERFAULT }, | ||
761 | }; | 762 | }; |
762 | int i; | 763 | int i; |
763 | 764 | ||