浏览代码

nfsd4: set sequence flag when backchannel is down

Implement the SEQ4_STATUS_CB_PATH_DOWN flag.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
J. Bruce Fields 14 年之前
父节点
当前提交
0d7bb71907
共有 3 个文件被更改,包括 8 次插入8 次删除
  1. 5 1
      fs/nfsd/nfs4state.c
  2. 2 6
      fs/nfsd/nfs4xdr.c
  3. 1 1
      fs/nfsd/xdr4.h

+ 5 - 1
fs/nfsd/nfs4state.c

@@ -1800,8 +1800,12 @@ nfsd4_sequence(struct svc_rqst *rqstp,
 out:
 out:
 	/* Hold a session reference until done processing the compound. */
 	/* Hold a session reference until done processing the compound. */
 	if (cstate->session) {
 	if (cstate->session) {
+		struct nfs4_client *clp = session->se_client;
+
 		nfsd4_get_session(cstate->session);
 		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);
 	kfree(conn);
 	spin_unlock(&client_lock);
 	spin_unlock(&client_lock);

+ 2 - 6
fs/nfsd/nfs4xdr.c

@@ -3137,13 +3137,9 @@ nfsd4_encode_sequence(struct nfsd4_compoundres *resp, int nfserr,
 	WRITE32(seq->seqid);
 	WRITE32(seq->seqid);
 	WRITE32(seq->slotid);
 	WRITE32(seq->slotid);
 	WRITE32(seq->maxslots);
 	WRITE32(seq->maxslots);
-	/*
-	 * FIXME: for now:
-	 *   target_maxslots = maxslots
-	 *   status_flags = 0
-	 */
+	/* For now: target_maxslots = maxslots */
 	WRITE32(seq->maxslots);
 	WRITE32(seq->maxslots);
-	WRITE32(0);
+	WRITE32(seq->status_flags);
 
 
 	ADJUST_ARGS();
 	ADJUST_ARGS();
 	resp->cstate.datap = p; /* DRC cache data pointer */
 	resp->cstate.datap = p; /* DRC cache data pointer */

+ 1 - 1
fs/nfsd/xdr4.h

@@ -378,8 +378,8 @@ struct nfsd4_sequence {
 	u32			cachethis;		/* request */
 	u32			cachethis;		/* request */
 #if 0
 #if 0
 	u32			target_maxslots;	/* response */
 	u32			target_maxslots;	/* response */
-	u32			status_flags;		/* response */
 #endif /* not yet */
 #endif /* not yet */
+	u32			status_flags;		/* response */
 };
 };
 
 
 struct nfsd4_destroy_session {
 struct nfsd4_destroy_session {