@@ -1064,6 +1064,17 @@ static bool nfsd4_queue_cb(struct nfsd4_callback *cb)
1064
1064
return queue_work (clp -> cl_callback_wq , & cb -> cb_work );
1065
1065
}
1066
1066
1067
+ static void nfsd4_requeue_cb (struct rpc_task * task , struct nfsd4_callback * cb )
1068
+ {
1069
+ struct nfs4_client * clp = cb -> cb_clp ;
1070
+
1071
+ if (!test_bit (NFSD4_CLIENT_CB_KILL , & clp -> cl_flags )) {
1072
+ trace_nfsd_cb_restart (clp , cb );
1073
+ task -> tk_status = 0 ;
1074
+ cb -> cb_need_restart = true;
1075
+ }
1076
+ }
1077
+
1067
1078
static void nfsd41_cb_inflight_begin (struct nfs4_client * clp )
1068
1079
{
1069
1080
atomic_inc (& clp -> cl_cb_inflight );
@@ -1331,26 +1342,9 @@ static void nfsd4_cb_prepare(struct rpc_task *task, void *calldata)
1331
1342
/* Returns true if CB_COMPOUND processing should continue */
1332
1343
static bool nfsd4_cb_sequence_done (struct rpc_task * task , struct nfsd4_callback * cb )
1333
1344
{
1334
- struct nfs4_client * clp = cb -> cb_clp ;
1335
- struct nfsd4_session * session = clp -> cl_cb_session ;
1345
+ struct nfsd4_session * session = cb -> cb_clp -> cl_cb_session ;
1336
1346
bool ret = false;
1337
1347
1338
- if (!clp -> cl_minorversion ) {
1339
- /*
1340
- * If the backchannel connection was shut down while this
1341
- * task was queued, we need to resubmit it after setting up
1342
- * a new backchannel connection.
1343
- *
1344
- * Note that if we lost our callback connection permanently
1345
- * the submission code will error out, so we don't need to
1346
- * handle that case here.
1347
- */
1348
- if (RPC_SIGNALLED (task ))
1349
- goto requeue ;
1350
-
1351
- return true;
1352
- }
1353
-
1354
1348
if (cb -> cb_held_slot < 0 )
1355
1349
goto requeue ;
1356
1350
@@ -1411,11 +1405,7 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback
1411
1405
rpc_restart_call_prepare (task );
1412
1406
goto out ;
1413
1407
requeue :
1414
- if (!test_bit (NFSD4_CLIENT_CB_KILL , & clp -> cl_flags )) {
1415
- trace_nfsd_cb_restart (clp , cb );
1416
- task -> tk_status = 0 ;
1417
- cb -> cb_need_restart = true;
1418
- }
1408
+ nfsd4_requeue_cb (task , cb );
1419
1409
return false;
1420
1410
}
1421
1411
@@ -1426,8 +1416,21 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata)
1426
1416
1427
1417
trace_nfsd_cb_rpc_done (clp );
1428
1418
1429
- if (!nfsd4_cb_sequence_done (task , cb ))
1419
+ if (!clp -> cl_minorversion ) {
1420
+ /*
1421
+ * If the backchannel connection was shut down while this
1422
+ * task was queued, we need to resubmit it after setting up
1423
+ * a new backchannel connection.
1424
+ *
1425
+ * Note that if we lost our callback connection permanently
1426
+ * the submission code will error out, so we don't need to
1427
+ * handle that case here.
1428
+ */
1429
+ if (RPC_SIGNALLED (task ))
1430
+ nfsd4_requeue_cb (task , cb );
1431
+ } else if (!nfsd4_cb_sequence_done (task , cb )) {
1430
1432
return ;
1433
+ }
1431
1434
1432
1435
if (cb -> cb_status ) {
1433
1436
WARN_ONCE (task -> tk_status ,
0 commit comments