From e205b424ff5db841003fbd92d99661adbecfa792 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Mon, 25 Oct 2010 18:11:21 -0400 Subject: [PATCH] --- yaml --- r: 231127 b: refs/heads/master c: f8c0d226fef05226ff1a85055c8ed663022f40c1 h: refs/heads/master i: 231125: ec187bb33374ec264ef6307747f7788e44f50c58 231123: 5add546cb094ec99462fe1374e83e8238fdb8c14 231119: 70eded36df2086b435b9aea2f935d54fe5083086 v: v3 --- [refs] | 2 +- trunk/net/sunrpc/svc_xprt.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 129e0c12fa2a..9b2d04e8d1fe 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ca7896cd83456082b1e78816cdf7e41658ef7bcd +refs/heads/master: f8c0d226fef05226ff1a85055c8ed663022f40c1 diff --git a/trunk/net/sunrpc/svc_xprt.c b/trunk/net/sunrpc/svc_xprt.c index dd61cd02461f..8c018df80692 100644 --- a/trunk/net/sunrpc/svc_xprt.c +++ b/trunk/net/sunrpc/svc_xprt.c @@ -941,16 +941,16 @@ void svc_close_all(struct list_head *xprt_list) struct svc_xprt *xprt; struct svc_xprt *tmp; + /* + * The server is shutting down, and no more threads are running. + * svc_xprt_enqueue() might still be running, but at worst it + * will re-add the xprt to sp_sockets, which will soon get + * freed. So we don't bother with any more locking, and don't + * leave the close to the (nonexistent) server threads: + */ list_for_each_entry_safe(xprt, tmp, xprt_list, xpt_list) { set_bit(XPT_CLOSE, &xprt->xpt_flags); - if (test_bit(XPT_BUSY, &xprt->xpt_flags)) { - /* Waiting to be processed, but no threads left, - * So just remove it from the waiting list - */ - list_del_init(&xprt->xpt_ready); - clear_bit(XPT_BUSY, &xprt->xpt_flags); - } - svc_close_xprt(xprt); + svc_delete_xprt(xprt); } }