Skip to content

Commit

Permalink
NFSv4.1 end back channel session draining
Browse files Browse the repository at this point in the history
We need to ensure that we clear NFS4_SLOT_TBL_DRAINING on the back
channel when we're done recovering the session.

Regression introduced by commit 774d5f1 (NFSv4.1 Fix a pNFS session
draining deadlock)

Signed-off-by: Andy Adamson <andros@netapp.com>
[Trond: Changed order to start back-channel first. Minor code cleanup]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@vger.kernel.org [>=3.10]
  • Loading branch information
Andy Adamson authored and Trond Myklebust committed Jun 20, 2013
1 parent 7dc0ac7 commit 62f288a
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions fs/nfs/nfs4state.c
Original file line number Diff line number Diff line change
@@ -228,26 +228,25 @@ static int nfs41_setup_state_renewal(struct nfs_client *clp)
return status;
}

/*
* Back channel returns NFS4ERR_DELAY for new requests when
* NFS4_SESSION_DRAINING is set so there is no work to be done when draining
* is ended.
*/
static void nfs4_end_drain_session(struct nfs_client *clp)
static void nfs4_end_drain_slot_table(struct nfs4_slot_table *tbl)
{
struct nfs4_session *ses = clp->cl_session;
struct nfs4_slot_table *tbl;

if (ses == NULL)
return;
tbl = &ses->fc_slot_table;
if (test_and_clear_bit(NFS4_SLOT_TBL_DRAINING, &tbl->slot_tbl_state)) {
spin_lock(&tbl->slot_tbl_lock);
nfs41_wake_slot_table(tbl);
spin_unlock(&tbl->slot_tbl_lock);
}
}

static void nfs4_end_drain_session(struct nfs_client *clp)
{
struct nfs4_session *ses = clp->cl_session;

if (ses != NULL) {
nfs4_end_drain_slot_table(&ses->bc_slot_table);
nfs4_end_drain_slot_table(&ses->fc_slot_table);
}
}

/*
* Signal state manager thread if session fore channel is drained
*/

0 comments on commit 62f288a

Please sign in to comment.