aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index a06a891012e5..b90d1bca4349 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -616,7 +616,7 @@ svc_prepare_thread(struct svc_serv *serv, struct svc_pool *pool, int node)
616 serv->sv_nrthreads++; 616 serv->sv_nrthreads++;
617 spin_lock_bh(&pool->sp_lock); 617 spin_lock_bh(&pool->sp_lock);
618 pool->sp_nrthreads++; 618 pool->sp_nrthreads++;
619 list_add(&rqstp->rq_all, &pool->sp_all_threads); 619 list_add_rcu(&rqstp->rq_all, &pool->sp_all_threads);
620 spin_unlock_bh(&pool->sp_lock); 620 spin_unlock_bh(&pool->sp_lock);
621 rqstp->rq_server = serv; 621 rqstp->rq_server = serv;
622 rqstp->rq_pool = pool; 622 rqstp->rq_pool = pool;
@@ -684,7 +684,8 @@ found_pool:
684 * so we don't try to kill it again. 684 * so we don't try to kill it again.
685 */ 685 */
686 rqstp = list_entry(pool->sp_all_threads.next, struct svc_rqst, rq_all); 686 rqstp = list_entry(pool->sp_all_threads.next, struct svc_rqst, rq_all);
687 list_del_init(&rqstp->rq_all); 687 set_bit(RQ_VICTIM, &rqstp->rq_flags);
688 list_del_rcu(&rqstp->rq_all);
688 task = rqstp->rq_task; 689 task = rqstp->rq_task;
689 } 690 }
690 spin_unlock_bh(&pool->sp_lock); 691 spin_unlock_bh(&pool->sp_lock);
@@ -782,10 +783,11 @@ svc_exit_thread(struct svc_rqst *rqstp)
782 783
783 spin_lock_bh(&pool->sp_lock); 784 spin_lock_bh(&pool->sp_lock);
784 pool->sp_nrthreads--; 785 pool->sp_nrthreads--;
785 list_del(&rqstp->rq_all); 786 if (!test_and_set_bit(RQ_VICTIM, &rqstp->rq_flags))
787 list_del_rcu(&rqstp->rq_all);
786 spin_unlock_bh(&pool->sp_lock); 788 spin_unlock_bh(&pool->sp_lock);
787 789
788 kfree(rqstp); 790 kfree_rcu(rqstp, rq_rcu_head);
789 791
790 /* Release the server */ 792 /* Release the server */
791 if (serv) 793 if (serv)