Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=404ec117be5d36e1a4c4582d0c518594333e32df
Commit:     404ec117be5d36e1a4c4582d0c518594333e32df
Parent:     35bba9a37e68c68a820a1a772f016255c0838f79
Author:     J. Bruce Fields <[EMAIL PROTECTED]>
AuthorDate: Fri Nov 23 22:26:18 2007 -0500
Committer:  J. Bruce Fields <[EMAIL PROTECTED]>
CommitDate: Fri Feb 1 16:42:06 2008 -0500

    nfsd4: recognize callback channel failure earlier
    
    When the callback channel fails, we inform the client of that by
    returning a cb_path_down error the next time it tries to renew its
    lease.
    
    If we wait most of a lease period before deciding that a callback has
    failed and that the callback channel is down, then we decrease the
    chances that the client will find out in time to do anything about it.
    
    So, mark the channel down as soon as we recognize that an rpc has
    failed.  However, continue trying to recall delegations anyway, in hopes
    it will come back up.  This will prevent more delegations from being
    given out, and ensure cb_path_down is returned to renew calls earlier,
    while still making the best effort to deliver recalls of existing
    delegations.
    
    Also fix a couple comments and remove a dprink that doesn't seem likely
    to be useful.
    
    Signed-off-by: J. Bruce Fields <[EMAIL PROTECTED]>
---
 fs/nfsd/nfs4callback.c |   13 +++++--------
 fs/nfsd/nfs4state.c    |    5 ++++-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 6eb5cd2..aae2b29 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -457,9 +457,6 @@ nfsd4_cb_recall(struct nfs4_delegation *dp)
        int retries = 1;
        int status = 0;
 
-       if ((!atomic_read(&clp->cl_callback.cb_set)) || !clnt)
-               return;
-
        cbr->cbr_trunc = 0; /* XXX need to implement truncate optimization */
        cbr->cbr_dp = dp;
 
@@ -468,6 +465,7 @@ nfsd4_cb_recall(struct nfs4_delegation *dp)
                switch (status) {
                        case -EIO:
                                /* Network partition? */
+                               atomic_set(&clp->cl_callback.cb_set, 0);
                        case -EBADHANDLE:
                        case -NFS4ERR_BAD_STATEID:
                                /* Race: client probably got cb_recall
@@ -480,11 +478,10 @@ nfsd4_cb_recall(struct nfs4_delegation *dp)
                status = rpc_call_sync(clnt, &msg, RPC_TASK_SOFT);
        }
 out_put_cred:
-       if (status == -EIO)
-               atomic_set(&clp->cl_callback.cb_set, 0);
-       /* Success or failure, now we're either waiting for lease expiration
-        * or deleg_return. */
-       dprintk("NFSD: nfs4_cb_recall: dp %p dl_flock %p dl_count %d\n",dp, 
dp->dl_flock, atomic_read(&dp->dl_count));
+       /*
+        * Success or failure, now we're either waiting for lease expiration
+        * or deleg_return.
+        */
        put_nfs4_client(clp);
        nfs4_put_delegation(dp);
        return;
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index b9d3958..11aa4b6 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -361,8 +361,11 @@ shutdown_callback_client(struct nfs4_client *clp)
 {
        struct rpc_clnt *clnt = clp->cl_callback.cb_client;
 
-       /* shutdown rpc client, ending any outstanding recall rpcs */
        if (clnt) {
+               /*
+                * Callback threads take a reference on the client, so there
+                * should be no outstanding callbacks at this point.
+                */
                clp->cl_callback.cb_client = NULL;
                rpc_shutdown_client(clnt);
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to