nfsd4: set sequence flag when backchannel is down
authorJ. Bruce Fields <bfields@redhat.com>
Thu, 18 Nov 2010 13:30:33 +0000 (08:30 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 11 Jan 2011 20:04:10 +0000 (15:04 -0500)
Implement the SEQ4_STATUS_CB_PATH_DOWN flag.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c
fs/nfsd/nfs4xdr.c
fs/nfsd/xdr4.h

index 919ad25660d60ed2035ee9d7005598cdf8c9ae06..15bd1cc77de749e879d62bb9e7553bbbf93f6f9b 100644 (file)
@@ -1800,8 +1800,12 @@ nfsd4_sequence(struct svc_rqst *rqstp,
 out:
        /* Hold a session reference until done processing the compound. */
        if (cstate->session) {
+               struct nfs4_client *clp = session->se_client;
+
                nfsd4_get_session(cstate->session);
-               atomic_inc(&session->se_client->cl_refcount);
+               atomic_inc(&clp->cl_refcount);
+               if (clp->cl_cb_state == NFSD4_CB_DOWN)
+                       seq->status_flags |= SEQ4_STATUS_CB_PATH_DOWN;
        }
        kfree(conn);
        spin_unlock(&client_lock);
index 4ff2c9e0b2769b836c3dbf93318745e34012dd26..956629b9cdc9c841a0f428ad12e9687cec21295f 100644 (file)
@@ -3137,13 +3137,9 @@ nfsd4_encode_sequence(struct nfsd4_compoundres *resp, int nfserr,
        WRITE32(seq->seqid);
        WRITE32(seq->slotid);
        WRITE32(seq->maxslots);
-       /*
-        * FIXME: for now:
-        *   target_maxslots = maxslots
-        *   status_flags = 0
-        */
+       /* For now: target_maxslots = maxslots */
        WRITE32(seq->maxslots);
-       WRITE32(0);
+       WRITE32(seq->status_flags);
 
        ADJUST_ARGS();
        resp->cstate.datap = p; /* DRC cache data pointer */
index 3a7aa4d98c1f31a5855c42f0247d57e7fb79812c..366401e1a536430f5314e2fe1496a777fd0dc31b 100644 (file)
@@ -378,8 +378,8 @@ struct nfsd4_sequence {
        u32                     cachethis;              /* request */
 #if 0
        u32                     target_maxslots;        /* response */
-       u32                     status_flags;           /* response */
 #endif /* not yet */
+       u32                     status_flags;           /* response */
 };
 
 struct nfsd4_destroy_session {