NFSv4.1: Various fixes to the sequence flag error handling
Subsystems (2)
PATCH 1/1 NFSv4.1: Various fixes to the sequence flag error handling
From: Trond Myklebust <[email protected]>
Ensure that we change the EXCHANGE_ID verifier (i.e. clp->cl_boot_time) when we want to reset all state. This is mainly needed when the server tells us that it is revoking our open or lock stateids.
Handle revoking of recallable state by expiring the delegations.
Handle callback path issues by expiring the delegations and then resetting the session.
---
fs/nfs/nfs4state.c | 57 +++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 45 insertions(+), 12 deletions(-)
fs/nfs/nfs4state.c +45 -12
@@ -1249,26 +1249,59 @@ static int nfs4_reclaim_lease(struct nfs_client *clp) }#ifdef CONFIG_NFS_V4_1 +static void nfs4_reset_all_state (struct nfs_client *clp) +{ +if (test_and_set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state)) { + clp->cl_boot_time =CURRENT_TIME ; +nfs4_state_start_reclaim_nograce (clp); +nfs4_schedule_state_recovery (clp); + } +} + +static void nfs41_handle_server_reboot (struct nfs_client *clp) +{ +if (test_and_set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state)) { +nfs4_state_start_reclaim_reboot (clp); +nfs4_schedule_state_recovery (clp); + } +} + +static void nfs41_handle_state_revoked (struct nfs_client *clp) +{ +/* Temporary */ +nfs4_reset_all_state (clp); +} + +static void nfs41_handle_recallable_state_revoked (struct nfs_client *clp) +{ +/* This will need to handle layouts too */ +nfs_expire_all_delegations (clp); +} + +static void nfs41_handle_cb_path_down (struct nfs_client *clp) +{ +nfs_expire_all_delegations (clp); +if (test_and_set_bit (NFS4CLNT_SESSION_RESET , &clp->cl_state)) +nfs4_schedule_state_recovery (clp); +} +void nfs41_handle_sequence_flag_errors (struct nfs_client *clp,u32 flags) {if (!flags)return ; -else if (flags &SEQ4_STATUS_RESTART_RECLAIM_NEEDED ) { -set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state); -nfs4_state_start_reclaim_reboot (clp); -nfs4_schedule_state_recovery (clp); - }else if (flags & (SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED | +else if (flags &SEQ4_STATUS_RESTART_RECLAIM_NEEDED ) +nfs41_handle_server_reboot (clp); +else if (flags & (SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED |SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED |SEQ4_STATUS_ADMIN_STATE_REVOKED | -SEQ4_STATUS_RECALLABLE_STATE_REVOKED | -SEQ4_STATUS_LEASE_MOVED )) { -set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state); -nfs4_state_start_reclaim_nograce (clp); -nfs4_schedule_state_recovery (clp); - }else if (flags & (SEQ4_STATUS_CB_PATH_DOWN | +SEQ4_STATUS_LEASE_MOVED )) +nfs41_handle_state_revoked (clp); +else if (flags &SEQ4_STATUS_RECALLABLE_STATE_REVOKED ) +nfs41_handle_recallable_state_revoked (clp); +else if (flags & (SEQ4_STATUS_CB_PATH_DOWN |SEQ4_STATUS_BACKCHANNEL_FAULT |SEQ4_STATUS_CB_PATH_DOWN_SESSION )) -nfs_expire_all_delegations (clp); +nfs41_handle_cb_path_down (clp); }static int nfs4_reset_session (struct nfs_client *clp)
A message that is not in the archive (sent off-list or not yet received): 1266719139.3507.5.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]
Quoted 23 lines · Trond Myklebust
From: Trond Myklebust <[email protected]>
Ensure that we change the
EXCHANGE_IDverifier (i.e.clp->cl_boot_time) when we want to reset all state. This is mainly needed when the server tells us that it is revoking our open or lock stateids.Handle revoking of recallable state by expiring the delegations.
Handle callback path issues by expiring the delegations and then resetting the session.
Signed-off-by Trond Myklebust <[email protected]>---
fs/nfs/nfs4state.c | 57 +++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 45 insertions(+), 12 deletions(-)fs/nfs/nfs4state.c +0
-0
fs/nfs/nfs4state.c static int nfs4_reclaim_lease(struct nfs_client *clp) · line 1254
Quoted 6 lines
fs/nfs/nfs4state.c +3
-0@@ -1249,26 +1249,59 @@ static int nfs4_reclaim_lease(struct nfs_client *clp) }#ifdef CONFIG_NFS_V4_1 +static void nfs4_reset_all_state (struct nfs_client *clp) +{ +if (test_and_set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state)) {
Doh!!! Should be 'if (!test_and_set_bit())....
Will resend.
fs/nfs/nfs4state.c static int nfs4_reclaim_lease(struct nfs_client *clp) · line 1263
Quoted 9 lines
fs/nfs/nfs4state.c +9
-0+ clp->cl_boot_time =CURRENT_TIME ; +nfs4_state_start_reclaim_nograce (clp); +nfs4_schedule_state_recovery (clp); + } +} + +static void nfs41_handle_server_reboot (struct nfs_client *clp) +{ +if (test_and_set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state)) {
Ditto
Quoted 11 lines
fs/nfs/nfs4state.c +11
-0+nfs4_state_start_reclaim_reboot (clp); +nfs4_schedule_state_recovery (clp); + } +} + +static void nfs41_handle_state_revoked (struct nfs_client *clp) +{ +/* Temporary */ +nfs4_reset_all_state (clp); +} +
fs/nfs/nfs4state.c static int nfs4_reclaim_lease(struct nfs_client *clp) · line 1284
Quoted 10 lines
fs/nfs/nfs4state.c +10
-0+static void nfs41_handle_recallable_state_revoked (struct nfs_client *clp) +{ +/* This will need to handle layouts too */ +nfs_expire_all_delegations (clp); +} + +static void nfs41_handle_cb_path_down (struct nfs_client *clp) +{ +nfs_expire_all_delegations (clp); +if (test_and_set_bit (NFS4CLNT_SESSION_RESET , &clp->cl_state))
Ditto
Quoted 40 lines
fs/nfs/nfs4state.c +12
-13+nfs4_schedule_state_recovery (clp); +} +void nfs41_handle_sequence_flag_errors (struct nfs_client *clp,u32 flags) {if (!flags)return ; -else if (flags &SEQ4_STATUS_RESTART_RECLAIM_NEEDED ) { -set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state); -nfs4_state_start_reclaim_reboot (clp); -nfs4_schedule_state_recovery (clp); - }else if (flags & (SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED | +else if (flags &SEQ4_STATUS_RESTART_RECLAIM_NEEDED ) +nfs41_handle_server_reboot (clp); +else if (flags & (SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED |SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED |SEQ4_STATUS_ADMIN_STATE_REVOKED | -SEQ4_STATUS_RECALLABLE_STATE_REVOKED | -SEQ4_STATUS_LEASE_MOVED )) { -set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state); -nfs4_state_start_reclaim_nograce (clp); -nfs4_schedule_state_recovery (clp); - }else if (flags & (SEQ4_STATUS_CB_PATH_DOWN | +SEQ4_STATUS_LEASE_MOVED )) +nfs41_handle_state_revoked (clp); +else if (flags &SEQ4_STATUS_RECALLABLE_STATE_REVOKED ) +nfs41_handle_recallable_state_revoked (clp); +else if (flags & (SEQ4_STATUS_CB_PATH_DOWN |SEQ4_STATUS_BACKCHANNEL_FAULT |SEQ4_STATUS_CB_PATH_DOWN_SESSION )) -nfs_expire_all_delegations (clp); +nfs41_handle_cb_path_down (clp); }static int nfs4_reset_session (struct nfs_client *clp) --To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 1/1 NFSv4.1: Various fixes to the sequence flag error handling
From: Trond Myklebust <[email protected]>
Ensure that we change the EXCHANGE_ID verifier (i.e. clp->cl_boot_time) when we want to reset all state. This is mainly needed when the server tells us that it is revoking our open or lock stateids.
Handle revoking of recallable state by expiring the delegations.
Handle callback path issues by expiring the delegations and then resetting the session.
---
fs/nfs/nfs4state.c | 57 +++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 45 insertions(+), 12 deletions(-)
fs/nfs/nfs4state.c +45 -12
@@ -1249,26 +1249,59 @@ static int nfs4_reclaim_lease(struct nfs_client *clp) }#ifdef CONFIG_NFS_V4_1 +static void nfs4_reset_all_state (struct nfs_client *clp) +{ +if (test_and_set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state) ==0 ) { + clp->cl_boot_time =CURRENT_TIME ; +nfs4_state_start_reclaim_nograce (clp); +nfs4_schedule_state_recovery (clp); + } +} + +static void nfs41_handle_server_reboot (struct nfs_client *clp) +{ +if (test_and_set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state) ==0 ) { +nfs4_state_start_reclaim_reboot (clp); +nfs4_schedule_state_recovery (clp); + } +} + +static void nfs41_handle_state_revoked (struct nfs_client *clp) +{ +/* Temporary */ +nfs4_reset_all_state (clp); +} + +static void nfs41_handle_recallable_state_revoked (struct nfs_client *clp) +{ +/* This will need to handle layouts too */ +nfs_expire_all_delegations (clp); +} + +static void nfs41_handle_cb_path_down (struct nfs_client *clp) +{ +nfs_expire_all_delegations (clp); +if (test_and_set_bit (NFS4CLNT_SESSION_RESET , &clp->cl_state) ==0 ) +nfs4_schedule_state_recovery (clp); +} +void nfs41_handle_sequence_flag_errors (struct nfs_client *clp,u32 flags) {if (!flags)return ; -else if (flags &SEQ4_STATUS_RESTART_RECLAIM_NEEDED ) { -set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state); -nfs4_state_start_reclaim_reboot (clp); -nfs4_schedule_state_recovery (clp); - }else if (flags & (SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED | +else if (flags &SEQ4_STATUS_RESTART_RECLAIM_NEEDED ) +nfs41_handle_server_reboot (clp); +else if (flags & (SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED |SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED |SEQ4_STATUS_ADMIN_STATE_REVOKED | -SEQ4_STATUS_RECALLABLE_STATE_REVOKED | -SEQ4_STATUS_LEASE_MOVED )) { -set_bit (NFS4CLNT_LEASE_EXPIRED , &clp->cl_state); -nfs4_state_start_reclaim_nograce (clp); -nfs4_schedule_state_recovery (clp); - }else if (flags & (SEQ4_STATUS_CB_PATH_DOWN | +SEQ4_STATUS_LEASE_MOVED )) +nfs41_handle_state_revoked (clp); +else if (flags &SEQ4_STATUS_RECALLABLE_STATE_REVOKED ) +nfs41_handle_recallable_state_revoked (clp); +else if (flags & (SEQ4_STATUS_CB_PATH_DOWN |SEQ4_STATUS_BACKCHANNEL_FAULT |SEQ4_STATUS_CB_PATH_DOWN_SESSION )) -nfs_expire_all_delegations (clp); +nfs41_handle_cb_path_down (clp); }static int nfs4_reset_session (struct nfs_client *clp)