aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-10 11:23:15 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-10 11:54:36 -0500
commitad1e3968292e3af1c49ccbd0fb7d2674010f8efc (patch)
tree5eee458017d2deeff73c27740d1bddd742a05990
parent4fc8796d23819da814ec25b7793bde8f104f1a2a (diff)
NFSv4.0: Re-establish the callback channel on NFS4ERR_CB_PATHDOWN
When the NFSv4.0 server tells us that it can no-longer talk to us on the callback channel, we should attempt a new SETCLIENTID in order to re-transmit the callback channel information. Note that as long as we do not change the boot verifier, this is a safe procedure; the server is required to keep our state. Also move the function nfs_handle_cb_pathdown to fs/nfs/nfs4state.c, and change the name in order to mark it as being specific to NFSv4.0. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/delegation.c17
-rw-r--r--fs/nfs/delegation.h1
-rw-r--r--fs/nfs/nfs4state.c18
3 files changed, 16 insertions, 20 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index e27c0972f94..12de88353ee 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -453,11 +453,6 @@ static void nfs_client_mark_return_all_delegation_types(struct nfs_client *clp,
453 rcu_read_unlock(); 453 rcu_read_unlock();
454} 454}
455 455
456static void nfs_client_mark_return_all_delegations(struct nfs_client *clp)
457{
458 nfs_client_mark_return_all_delegation_types(clp, FMODE_READ|FMODE_WRITE);
459}
460
461static void nfs_delegation_run_state_manager(struct nfs_client *clp) 456static void nfs_delegation_run_state_manager(struct nfs_client *clp)
462{ 457{
463 if (test_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state)) 458 if (test_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state))
@@ -498,18 +493,6 @@ void nfs_expire_all_delegations(struct nfs_client *clp)
498 nfs_expire_all_delegation_types(clp, FMODE_READ|FMODE_WRITE); 493 nfs_expire_all_delegation_types(clp, FMODE_READ|FMODE_WRITE);
499} 494}
500 495
501/**
502 * nfs_handle_cb_pathdown - return all delegations after NFS4ERR_CB_PATH_DOWN
503 * @clp: client to process
504 *
505 */
506void nfs_handle_cb_pathdown(struct nfs_client *clp)
507{
508 if (clp == NULL)
509 return;
510 nfs_client_mark_return_all_delegations(clp);
511}
512
513static void nfs_mark_return_unreferenced_delegations(struct nfs_server *server) 496static void nfs_mark_return_unreferenced_delegations(struct nfs_server *server)
514{ 497{
515 struct nfs_delegation *delegation; 498 struct nfs_delegation *delegation;
diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h
index e193012123e..cd6a7a8dada 100644
--- a/fs/nfs/delegation.h
+++ b/fs/nfs/delegation.h
@@ -42,7 +42,6 @@ void nfs_super_return_all_delegations(struct super_block *sb);
42void nfs_expire_all_delegations(struct nfs_client *clp); 42void nfs_expire_all_delegations(struct nfs_client *clp);
43void nfs_expire_all_delegation_types(struct nfs_client *clp, fmode_t flags); 43void nfs_expire_all_delegation_types(struct nfs_client *clp, fmode_t flags);
44void nfs_expire_unreferenced_delegations(struct nfs_client *clp); 44void nfs_expire_unreferenced_delegations(struct nfs_client *clp);
45void nfs_handle_cb_pathdown(struct nfs_client *clp);
46int nfs_client_return_marked_delegations(struct nfs_client *clp); 45int nfs_client_return_marked_delegations(struct nfs_client *clp);
47int nfs_delegations_present(struct nfs_client *clp); 46int nfs_delegations_present(struct nfs_client *clp);
48void nfs_remove_bad_delegation(struct inode *inode); 47void nfs_remove_bad_delegation(struct inode *inode);
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index de44804d986..5fa43cd9bfc 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1097,9 +1097,23 @@ void nfs4_schedule_lease_recovery(struct nfs_client *clp)
1097} 1097}
1098EXPORT_SYMBOL_GPL(nfs4_schedule_lease_recovery); 1098EXPORT_SYMBOL_GPL(nfs4_schedule_lease_recovery);
1099 1099
1100/*
1101 * nfs40_handle_cb_pathdown - return all delegations after NFS4ERR_CB_PATH_DOWN
1102 * @clp: client to process
1103 *
1104 * Set the NFS4CLNT_LEASE_EXPIRED state in order to force a
1105 * resend of the SETCLIENTID and hence re-establish the
1106 * callback channel. Then return all existing delegations.
1107 */
1108static void nfs40_handle_cb_pathdown(struct nfs_client *clp)
1109{
1110 set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
1111 nfs_expire_all_delegations(clp);
1112}
1113
1100void nfs4_schedule_path_down_recovery(struct nfs_client *clp) 1114void nfs4_schedule_path_down_recovery(struct nfs_client *clp)
1101{ 1115{
1102 nfs_handle_cb_pathdown(clp); 1116 nfs40_handle_cb_pathdown(clp);
1103 nfs4_schedule_state_manager(clp); 1117 nfs4_schedule_state_manager(clp);
1104} 1118}
1105 1119
@@ -1444,7 +1458,7 @@ static int nfs4_recovery_handle_error(struct nfs_client *clp, int error)
1444 case 0: 1458 case 0:
1445 break; 1459 break;
1446 case -NFS4ERR_CB_PATH_DOWN: 1460 case -NFS4ERR_CB_PATH_DOWN:
1447 nfs_handle_cb_pathdown(clp); 1461 nfs40_handle_cb_pathdown(clp);
1448 break; 1462 break;
1449 case -NFS4ERR_NO_GRACE: 1463 case -NFS4ERR_NO_GRACE:
1450 nfs4_state_end_reclaim_reboot(clp); 1464 nfs4_state_end_reclaim_reboot(clp);