aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2007-07-19 04:49:18 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:52 -0400
commit9a25b96c1f6e1a3c85c9524f3046c7c75d8fecc7 (patch)
treeaacaf5f3616f7e24a6fe66b5df136b521ccaa557 /fs
parenta280df32db291f41b3922ac218674be526af5b9b (diff)
nfsd: return errors, not NULL, from export functions
I converted the various export-returning functions to return -ENOENT instead of NULL, but missed a few cases. This particular case could cause actual bugs in the case of a krb5 client that doesn't match any ip-based client and that is trying to access a filesystem not exported to krb5 clients. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Acked-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/export.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index c7bbf460b009..6ab8de40904c 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1265,7 +1265,7 @@ struct svc_export *
1265rqst_exp_get_by_name(struct svc_rqst *rqstp, struct vfsmount *mnt, 1265rqst_exp_get_by_name(struct svc_rqst *rqstp, struct vfsmount *mnt,
1266 struct dentry *dentry) 1266 struct dentry *dentry)
1267{ 1267{
1268 struct svc_export *gssexp, *exp = NULL; 1268 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT);
1269 1269
1270 if (rqstp->rq_client == NULL) 1270 if (rqstp->rq_client == NULL)
1271 goto gss; 1271 goto gss;
@@ -1288,7 +1288,7 @@ gss:
1288 &rqstp->rq_chandle); 1288 &rqstp->rq_chandle);
1289 if (PTR_ERR(gssexp) == -ENOENT) 1289 if (PTR_ERR(gssexp) == -ENOENT)
1290 return exp; 1290 return exp;
1291 if (exp && !IS_ERR(exp)) 1291 if (!IS_ERR(exp))
1292 exp_put(exp); 1292 exp_put(exp);
1293 return gssexp; 1293 return gssexp;
1294} 1294}
@@ -1296,7 +1296,7 @@ gss:
1296struct svc_export * 1296struct svc_export *
1297rqst_exp_find(struct svc_rqst *rqstp, int fsid_type, u32 *fsidv) 1297rqst_exp_find(struct svc_rqst *rqstp, int fsid_type, u32 *fsidv)
1298{ 1298{
1299 struct svc_export *gssexp, *exp = NULL; 1299 struct svc_export *gssexp, *exp = ERR_PTR(-ENOENT);
1300 1300
1301 if (rqstp->rq_client == NULL) 1301 if (rqstp->rq_client == NULL)
1302 goto gss; 1302 goto gss;
@@ -1318,7 +1318,7 @@ gss:
1318 &rqstp->rq_chandle); 1318 &rqstp->rq_chandle);
1319 if (PTR_ERR(gssexp) == -ENOENT) 1319 if (PTR_ERR(gssexp) == -ENOENT)
1320 return exp; 1320 return exp;
1321 if (exp && !IS_ERR(exp)) 1321 if (!IS_ERR(exp))
1322 exp_put(exp); 1322 exp_put(exp);
1323 return gssexp; 1323 return gssexp;
1324} 1324}