diff options
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_export.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c index 595751f7835..87b8cbd23d4 100644 --- a/fs/xfs/linux-2.6/xfs_export.c +++ b/fs/xfs/linux-2.6/xfs_export.c | |||
@@ -126,11 +126,26 @@ xfs_nfs_get_inode( | |||
126 | if (ino == 0) | 126 | if (ino == 0) |
127 | return ERR_PTR(-ESTALE); | 127 | return ERR_PTR(-ESTALE); |
128 | 128 | ||
129 | error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0); | 129 | /* |
130 | if (error) | 130 | * The XFS_IGET_BULKSTAT means that an invalid inode number is just |
131 | * fine and not an indication of a corrupted filesystem. Because | ||
132 | * clients can send any kind of invalid file handle, e.g. after | ||
133 | * a restore on the server we have to deal with this case gracefully. | ||
134 | */ | ||
135 | error = xfs_iget(mp, NULL, ino, XFS_IGET_BULKSTAT, | ||
136 | XFS_ILOCK_SHARED, &ip, 0); | ||
137 | if (error) { | ||
138 | /* | ||
139 | * EINVAL means the inode cluster doesn't exist anymore. | ||
140 | * This implies the filehandle is stale, so we should | ||
141 | * translate it here. | ||
142 | * We don't use ESTALE directly down the chain to not | ||
143 | * confuse applications using bulkstat that expect EINVAL. | ||
144 | */ | ||
145 | if (error == EINVAL) | ||
146 | error = ESTALE; | ||
131 | return ERR_PTR(-error); | 147 | return ERR_PTR(-error); |
132 | if (!ip) | 148 | } |
133 | return ERR_PTR(-EIO); | ||
134 | 149 | ||
135 | if (ip->i_d.di_gen != generation) { | 150 | if (ip->i_d.di_gen != generation) { |
136 | xfs_iput_new(ip, XFS_ILOCK_SHARED); | 151 | xfs_iput_new(ip, XFS_ILOCK_SHARED); |