Commit 62f288a02f97bd9f6b2361a6fff709729fe9e110

Authored by Andy Adamson
Committed by Trond Myklebust
1 parent 7dc0ac70f8

NFSv4.1 end back channel session draining

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 774d5f14e (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]

Showing 1 changed file with 11 additions and 12 deletions Side-by-side Diff

... ... @@ -228,23 +228,22 @@
228 228 return status;
229 229 }
230 230  
231   -/*
232   - * Back channel returns NFS4ERR_DELAY for new requests when
233   - * NFS4_SESSION_DRAINING is set so there is no work to be done when draining
234   - * is ended.
235   - */
236   -static void nfs4_end_drain_session(struct nfs_client *clp)
  231 +static void nfs4_end_drain_slot_table(struct nfs4_slot_table *tbl)
237 232 {
238   - struct nfs4_session *ses = clp->cl_session;
239   - struct nfs4_slot_table *tbl;
240   -
241   - if (ses == NULL)
242   - return;
243   - tbl = &ses->fc_slot_table;
244 233 if (test_and_clear_bit(NFS4_SLOT_TBL_DRAINING, &tbl->slot_tbl_state)) {
245 234 spin_lock(&tbl->slot_tbl_lock);
246 235 nfs41_wake_slot_table(tbl);
247 236 spin_unlock(&tbl->slot_tbl_lock);
  237 + }
  238 +}
  239 +
  240 +static void nfs4_end_drain_session(struct nfs_client *clp)
  241 +{
  242 + struct nfs4_session *ses = clp->cl_session;
  243 +
  244 + if (ses != NULL) {
  245 + nfs4_end_drain_slot_table(&ses->bc_slot_table);
  246 + nfs4_end_drain_slot_table(&ses->fc_slot_table);
248 247 }
249 248 }
250 249