aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4_fs.h
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-03-14 16:57:48 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-03-25 12:04:10 -0400
commit5d422301f97b821301efcdb6fc9d1a83a5c102d6 (patch)
treeed7117feb89a0a804669f9f017d2ce3ef7fee10c /fs/nfs/nfs4_fs.h
parent3ed5e2a2c394df4e03a680842c2d07a8680f133b (diff)
NFSv4: Fail I/O if the state recovery fails irrevocably
If state recovery fails with an ESTALE or a ENOENT, then we shouldn't keep retrying. Instead, mark the stateid as being invalid and fail the I/O with an EIO error. For other operations such as POSIX and BSD file locking, truncate etc, fail with an EBADF to indicate that this file descriptor is no longer valid. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4_fs.h')
-rw-r--r--fs/nfs/nfs4_fs.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 944c9a5c1039..9ce90135bf22 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -149,6 +149,7 @@ enum {
149 NFS_STATE_RECLAIM_REBOOT, /* OPEN stateid server rebooted */ 149 NFS_STATE_RECLAIM_REBOOT, /* OPEN stateid server rebooted */
150 NFS_STATE_RECLAIM_NOGRACE, /* OPEN stateid needs to recover state */ 150 NFS_STATE_RECLAIM_NOGRACE, /* OPEN stateid needs to recover state */
151 NFS_STATE_POSIX_LOCKS, /* Posix locks are supported */ 151 NFS_STATE_POSIX_LOCKS, /* Posix locks are supported */
152 NFS_STATE_RECOVERY_FAILED, /* OPEN stateid state recovery failed */
152}; 153};
153 154
154struct nfs4_state { 155struct nfs4_state {
@@ -347,7 +348,7 @@ extern int nfs4_wait_clnt_recover(struct nfs_client *clp);
347extern int nfs4_client_recover_expired_lease(struct nfs_client *clp); 348extern int nfs4_client_recover_expired_lease(struct nfs_client *clp);
348extern void nfs4_schedule_state_manager(struct nfs_client *); 349extern void nfs4_schedule_state_manager(struct nfs_client *);
349extern void nfs4_schedule_path_down_recovery(struct nfs_client *clp); 350extern void nfs4_schedule_path_down_recovery(struct nfs_client *clp);
350extern void nfs4_schedule_stateid_recovery(const struct nfs_server *, struct nfs4_state *); 351extern int nfs4_schedule_stateid_recovery(const struct nfs_server *, struct nfs4_state *);
351extern void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags); 352extern void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags);
352extern void nfs41_handle_server_scope(struct nfs_client *, 353extern void nfs41_handle_server_scope(struct nfs_client *,
353 struct nfs41_server_scope **); 354 struct nfs41_server_scope **);
@@ -412,6 +413,11 @@ static inline bool nfs4_stateid_match(const nfs4_stateid *dst, const nfs4_statei
412 return memcmp(dst, src, sizeof(*dst)) == 0; 413 return memcmp(dst, src, sizeof(*dst)) == 0;
413} 414}
414 415
416static inline bool nfs4_valid_open_stateid(const struct nfs4_state *state)
417{
418 return test_bit(NFS_STATE_RECOVERY_FAILED, &state->flags) == 0;
419}
420
415#else 421#else
416 422
417#define nfs4_close_state(a, b) do { } while (0) 423#define nfs4_close_state(a, b) do { } while (0)