diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:48 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:48 -0500 |
commit | 03f28e3a2059fc466761d872122f30acb7be61ae (patch) | |
tree | d478e553b79520c34bb3d06e75b59609de2993f4 /fs/nfs/dir.c | |
parent | 01d0ae8beaee75d954900109619b700fe68707d9 (diff) |
NFS: Make nfs_fhget() return appropriate error values
Currently it returns NULL, which usually gets interpreted as ENOMEM. In
fact it can mean a host of issues.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 609185a15c99..06c48b385c94 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -901,9 +901,9 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru | |||
901 | res = ERR_PTR(error); | 901 | res = ERR_PTR(error); |
902 | goto out_unlock; | 902 | goto out_unlock; |
903 | } | 903 | } |
904 | res = ERR_PTR(-EACCES); | ||
905 | inode = nfs_fhget(dentry->d_sb, &fhandle, &fattr); | 904 | inode = nfs_fhget(dentry->d_sb, &fhandle, &fattr); |
906 | if (!inode) | 905 | res = (struct dentry *)inode; |
906 | if (IS_ERR(res)) | ||
907 | goto out_unlock; | 907 | goto out_unlock; |
908 | no_entry: | 908 | no_entry: |
909 | res = d_add_unique(dentry, inode); | 909 | res = d_add_unique(dentry, inode); |
@@ -1096,7 +1096,7 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc) | |||
1096 | return NULL; | 1096 | return NULL; |
1097 | dentry->d_op = NFS_PROTO(dir)->dentry_ops; | 1097 | dentry->d_op = NFS_PROTO(dir)->dentry_ops; |
1098 | inode = nfs_fhget(dentry->d_sb, entry->fh, entry->fattr); | 1098 | inode = nfs_fhget(dentry->d_sb, entry->fh, entry->fattr); |
1099 | if (!inode) { | 1099 | if (IS_ERR(inode)) { |
1100 | dput(dentry); | 1100 | dput(dentry); |
1101 | return NULL; | 1101 | return NULL; |
1102 | } | 1102 | } |
@@ -1134,9 +1134,9 @@ int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fhandle, | |||
1134 | if (error < 0) | 1134 | if (error < 0) |
1135 | goto out_err; | 1135 | goto out_err; |
1136 | } | 1136 | } |
1137 | error = -ENOMEM; | ||
1138 | inode = nfs_fhget(dentry->d_sb, fhandle, fattr); | 1137 | inode = nfs_fhget(dentry->d_sb, fhandle, fattr); |
1139 | if (inode == NULL) | 1138 | error = PTR_ERR(inode); |
1139 | if (IS_ERR(inode)) | ||
1140 | goto out_err; | 1140 | goto out_err; |
1141 | d_instantiate(dentry, inode); | 1141 | d_instantiate(dentry, inode); |
1142 | return 0; | 1142 | return 0; |