提交 0f79fd6f 编写于 作者: T Trond Myklebust

NFSv4.1: Various fixes to the sequence flag error handling

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.
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 0851de06
...@@ -1255,26 +1255,59 @@ void nfs41_handle_recall_slot(struct nfs_client *clp) ...@@ -1255,26 +1255,59 @@ void nfs41_handle_recall_slot(struct nfs_client *clp)
nfs4_schedule_state_recovery(clp); nfs4_schedule_state_recovery(clp);
} }
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) void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags)
{ {
if (!flags) if (!flags)
return; return;
else if (flags & SEQ4_STATUS_RESTART_RECLAIM_NEEDED) { else if (flags & SEQ4_STATUS_RESTART_RECLAIM_NEEDED)
set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); nfs41_handle_server_reboot(clp);
nfs4_state_start_reclaim_reboot(clp); else if (flags & (SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED |
nfs4_schedule_state_recovery(clp);
} else if (flags & (SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED |
SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED | SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED |
SEQ4_STATUS_ADMIN_STATE_REVOKED | SEQ4_STATUS_ADMIN_STATE_REVOKED |
SEQ4_STATUS_RECALLABLE_STATE_REVOKED | SEQ4_STATUS_LEASE_MOVED))
SEQ4_STATUS_LEASE_MOVED)) { nfs41_handle_state_revoked(clp);
set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); else if (flags & SEQ4_STATUS_RECALLABLE_STATE_REVOKED)
nfs4_state_start_reclaim_nograce(clp); nfs41_handle_recallable_state_revoked(clp);
nfs4_schedule_state_recovery(clp); else if (flags & (SEQ4_STATUS_CB_PATH_DOWN |
} else if (flags & (SEQ4_STATUS_CB_PATH_DOWN |
SEQ4_STATUS_BACKCHANNEL_FAULT | SEQ4_STATUS_BACKCHANNEL_FAULT |
SEQ4_STATUS_CB_PATH_DOWN_SESSION)) 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) static int nfs4_reset_session(struct nfs_client *clp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册