Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320191
b: refs/heads/master
c: 8ed27d4
h: refs/heads/master
i:
  320189: bb10ef6
  320187: db7ca26
  320183: c78a443
  320175: e30f0dd
  320159: ab742f9
  320127: 386170a
v: v3
  • Loading branch information
Weston Andros Adamson authored and Trond Myklebust committed Jun 28, 2012
1 parent ba8d5f9 commit 2651e24
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f8bb7f08549a1ced9ceb69a9bd5e163122044ab2
refs/heads/master: 8ed27d4fb1ce95e65f5a3b26b02d3b77135cc7a1
16 changes: 14 additions & 2 deletions trunk/fs/nfs/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1857,10 +1857,12 @@ static int nfs4_bind_conn_to_session(struct nfs_client *clp)
static void nfs4_state_manager(struct nfs_client *clp)
{
int status = 0;
const char *section = "", *section_sep = "";

/* Ensure exclusive access to NFSv4 state */
do {
if (test_bit(NFS4CLNT_PURGE_STATE, &clp->cl_state)) {
section = "purge state";
status = nfs4_reclaim_lease(clp);
if (status < 0)
goto out_error;
Expand All @@ -1869,6 +1871,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
}

if (test_and_clear_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) {
section = "lease expired";
/* We're going to have to re-establish a clientid */
status = nfs4_reclaim_lease(clp);
if (status < 0)
Expand All @@ -1888,6 +1891,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
}

if (test_and_clear_bit(NFS4CLNT_CHECK_LEASE, &clp->cl_state)) {
section = "check lease";
status = nfs4_check_lease(clp);
if (status < 0)
goto out_error;
Expand All @@ -1898,6 +1902,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
/* Initialize or reset the session */
if (test_and_clear_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state)
&& nfs4_has_session(clp)) {
section = "reset session";
status = nfs4_reset_session(clp);
if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state))
continue;
Expand All @@ -1908,6 +1913,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
/* Send BIND_CONN_TO_SESSION */
if (test_and_clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION,
&clp->cl_state) && nfs4_has_session(clp)) {
section = "bind conn to session";
status = nfs4_bind_conn_to_session(clp);
if (status < 0)
goto out_error;
Expand All @@ -1916,6 +1922,7 @@ static void nfs4_state_manager(struct nfs_client *clp)

/* First recover reboot state... */
if (test_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state)) {
section = "reclaim reboot";
status = nfs4_do_reclaim(clp,
clp->cl_mvops->reboot_recovery_ops);
if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) ||
Expand All @@ -1930,6 +1937,7 @@ static void nfs4_state_manager(struct nfs_client *clp)

/* Now recover expired state... */
if (test_and_clear_bit(NFS4CLNT_RECLAIM_NOGRACE, &clp->cl_state)) {
section = "reclaim nograce";
status = nfs4_do_reclaim(clp,
clp->cl_mvops->nograce_recovery_ops);
if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) ||
Expand All @@ -1948,6 +1956,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
/* Recall session slots */
if (test_and_clear_bit(NFS4CLNT_RECALL_SLOT, &clp->cl_state)
&& nfs4_has_session(clp)) {
section = "recall slot";
status = nfs4_recall_slot(clp);
if (status < 0)
goto out_error;
Expand All @@ -1964,8 +1973,11 @@ static void nfs4_state_manager(struct nfs_client *clp)
} while (atomic_read(&clp->cl_count) > 1);
return;
out_error:
pr_warn_ratelimited("NFS: state manager failed on NFSv4 server %s"
" with error %d\n", clp->cl_hostname, -status);
if (strlen(section))
section_sep = ": ";
pr_warn_ratelimited("NFS: state manager%s%s failed on NFSv4 server %s"
" with error %d\n", section_sep, section,
clp->cl_hostname, -status);
nfs4_end_drain_session(clp);
nfs4_clear_state_manager_bit(clp);
}
Expand Down

0 comments on commit 2651e24

Please sign in to comment.