]> git.karo-electronics.de Git - linux-beck.git/commitdiff
NFSv4.0: Re-establish the callback channel on NFS4ERR_CB_PATHDOWN
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 10 Mar 2012 16:23:15 +0000 (11:23 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 10 Mar 2012 16:54:36 +0000 (11:54 -0500)
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>
fs/nfs/delegation.c
fs/nfs/delegation.h
fs/nfs/nfs4state.c

index e27c0972f94e2bc44b61d5d615d171bb0b6654c5..12de88353eebe8736eef0cca8fd19be75041abe3 100644 (file)
@@ -453,11 +453,6 @@ static void nfs_client_mark_return_all_delegation_types(struct nfs_client *clp,
        rcu_read_unlock();
 }
 
-static void nfs_client_mark_return_all_delegations(struct nfs_client *clp)
-{
-       nfs_client_mark_return_all_delegation_types(clp, FMODE_READ|FMODE_WRITE);
-}
-
 static void nfs_delegation_run_state_manager(struct nfs_client *clp)
 {
        if (test_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state))
@@ -498,18 +493,6 @@ void nfs_expire_all_delegations(struct nfs_client *clp)
        nfs_expire_all_delegation_types(clp, FMODE_READ|FMODE_WRITE);
 }
 
-/**
- * nfs_handle_cb_pathdown - return all delegations after NFS4ERR_CB_PATH_DOWN
- * @clp: client to process
- *
- */
-void nfs_handle_cb_pathdown(struct nfs_client *clp)
-{
-       if (clp == NULL)
-               return;
-       nfs_client_mark_return_all_delegations(clp);
-}
-
 static void nfs_mark_return_unreferenced_delegations(struct nfs_server *server)
 {
        struct nfs_delegation *delegation;
index e193012123e76c11ea43b8a07b2109f83cf8611d..cd6a7a8dadae9054e5bd5557c0226bfd8accc116 100644 (file)
@@ -42,7 +42,6 @@ void nfs_super_return_all_delegations(struct super_block *sb);
 void nfs_expire_all_delegations(struct nfs_client *clp);
 void nfs_expire_all_delegation_types(struct nfs_client *clp, fmode_t flags);
 void nfs_expire_unreferenced_delegations(struct nfs_client *clp);
-void nfs_handle_cb_pathdown(struct nfs_client *clp);
 int nfs_client_return_marked_delegations(struct nfs_client *clp);
 int nfs_delegations_present(struct nfs_client *clp);
 void nfs_remove_bad_delegation(struct inode *inode);
index de44804d9864e5814005e760f59471087f03ef0e..5fa43cd9bfc5705eb44568061ba02cfcd328878f 100644 (file)
@@ -1097,9 +1097,23 @@ void nfs4_schedule_lease_recovery(struct nfs_client *clp)
 }
 EXPORT_SYMBOL_GPL(nfs4_schedule_lease_recovery);
 
+/*
+ * nfs40_handle_cb_pathdown - return all delegations after NFS4ERR_CB_PATH_DOWN
+ * @clp: client to process
+ *
+ * Set the NFS4CLNT_LEASE_EXPIRED state in order to force a
+ * resend of the SETCLIENTID and hence re-establish the
+ * callback channel. Then return all existing delegations.
+ */
+static void nfs40_handle_cb_pathdown(struct nfs_client *clp)
+{
+       set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
+       nfs_expire_all_delegations(clp);
+}
+
 void nfs4_schedule_path_down_recovery(struct nfs_client *clp)
 {
-       nfs_handle_cb_pathdown(clp);
+       nfs40_handle_cb_pathdown(clp);
        nfs4_schedule_state_manager(clp);
 }
 
@@ -1444,7 +1458,7 @@ static int nfs4_recovery_handle_error(struct nfs_client *clp, int error)
                case 0:
                        break;
                case -NFS4ERR_CB_PATH_DOWN:
-                       nfs_handle_cb_pathdown(clp);
+                       nfs40_handle_cb_pathdown(clp);
                        break;
                case -NFS4ERR_NO_GRACE:
                        nfs4_state_end_reclaim_reboot(clp);