aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-07-14 16:50:36 -0400
committerAlex Elder <aelder@sgi.com>2011-07-20 19:35:21 -0400
commitad1a2c878ca70829874b4fcc83223cccb4e26dab (patch)
treefe664063bf7675a1be90c8c61c5ec7e09f99300e /fs/xfs/linux-2.6
parentadab0f67d1cdaf468bbc311bce4d61f17626a536 (diff)
xfs: failure mapping nfs fh to inode should return ESTALE
On xfs exports, nfsd is incorrectly returning ENOENT instead of ESTALE on attempts to use a filehandle of a deleted file (spotted with pynfs test PUTFH3). The ENOENT was coming from xfs_iget. (It's tempting to wonder whether we should just map all xfs_iget errors to ESTALE, but I don't believe so--xfs_iget can also return ENOMEM at least, which we wouldn't want mapped to ESTALE.) While we're at it, the other return of ENOENT in xfs_nfs_get_inode() also looks wrong. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_export.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c
index f4f878fc0083..75e5d322e48f 100644
--- a/fs/xfs/linux-2.6/xfs_export.c
+++ b/fs/xfs/linux-2.6/xfs_export.c
@@ -151,14 +151,14 @@ xfs_nfs_get_inode(
151 * We don't use ESTALE directly down the chain to not 151 * We don't use ESTALE directly down the chain to not
152 * confuse applications using bulkstat that expect EINVAL. 152 * confuse applications using bulkstat that expect EINVAL.
153 */ 153 */
154 if (error == EINVAL) 154 if (error == EINVAL || error == ENOENT)
155 error = ESTALE; 155 error = ESTALE;
156 return ERR_PTR(-error); 156 return ERR_PTR(-error);
157 } 157 }
158 158
159 if (ip->i_d.di_gen != generation) { 159 if (ip->i_d.di_gen != generation) {
160 IRELE(ip); 160 IRELE(ip);
161 return ERR_PTR(-ENOENT); 161 return ERR_PTR(-ESTALE);
162 } 162 }
163 163
164 return VFS_I(ip); 164 return VFS_I(ip);