srp_daemon: Don't create async_ev_thread if only run once
PATCH 1/1 srp_daemon: Don't create async_ev_thread if only run once
From: Honggang Li <[email protected]>
fd3005f0cd34 moves the signal handler setup from ibsrpdm path. So, default signal handler will be used when the main pthread send signal SIGINT to pthread async_ev_thread. ibsrpdm will exit with non-zero exit code as default signal handler killed it. ibsrpdm should return with exit code zero, if no error emerged.
We should not create async_ev_thread for ibsrpdm.
--- srp_daemon/srp_daemon.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
srp_daemon/srp_daemon.c +5 -5
@@ -1945,12 +1945,12 @@ static struct resources *alloc_res(void) run_thread_get_trap_notices, &res->res);if (ret) goto err; - } - ret =pthread_create (&res->res.async_ev_thread,NULL , - run_thread_listen_to_events, &res->res); -if (ret) - goto err; + ret =pthread_create (&res->res.async_ev_thread,NULL , + run_thread_listen_to_events, &res->res); +if (ret) + goto err; + }if (config->retry_timeout && !config->once) { ret = pthread_create(&res->res.reconnect_thread, NULL,
Signature · 6 lines
2.14.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20171219190958.3189-1-honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Nicolas Morey-Chaisemartin
Reviewed-byLe 19/12/2017 à 20:09, Honggang LI a écrit :
Quoted 29 lines
From: Honggang Li <[email protected]>
fd3005f0cd34moves the signal handler setup from ibsrpdm path. So, default signal handler will be used when the main pthread send signal SIGINT to pthreadasync_ev_thread. ibsrpdm will exit with non-zero exit code as default signal handler killed it. ibsrpdm should return with exit code zero, if no error emerged.We should not create
async_ev_threadfor ibsrpdm.Fixes fd3005f0cd34 ("srp_daemon: Move the setup of the wakeup_pipe after openlog")Reviewed-by Bart Van Assche <[email protected]>Signed-off-by Honggang Li <[email protected]>--- srp_daemon/srp_daemon.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)srp_daemon/srp_daemon.c +0
-3@@ -1945,12 +1945,12 @@ static struct resources *alloc_res(void) run_thread_get_trap_notices, &res->res);if (ret) goto err; - } - ret =pthread_create (&res->res.async_ev_thread,NULL , - run_thread_listen_to_events, &res->res);
srp_daemon/srp_daemon.c static struct resources *alloc_res(void) · line 1956
Quoted 10 lines
srp_daemon/srp_daemon.c +5
-2-if (ret) - goto err; + ret =pthread_create (&res->res.async_ev_thread,NULL , + run_thread_listen_to_events, &res->res); +if (ret) + goto err; + }if (config->retry_timeout && !config->once) { ret = pthread_create(&res->res.reconnect_thread, NULL,
Note: I will backport this to stable-v1[56] branches once its in master --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): ea3fe465-cc3b-1db3-e274-8c13f976953c-l3A5Bk7waGM@public.gmane.org
Quoted 40 lines · Nicolas Morey-Chaisemartin
Le 19/12/2017 à 20:09, Honggang LI a écrit :
Quoted 37 lines
From: Honggang Li <[email protected]>
fd3005f0cd34moves the signal handler setup from ibsrpdm path. So, default signal handler will be used when the main pthread send signal SIGINT to pthreadasync_ev_thread. ibsrpdm will exit with non-zero exit code as default signal handler killed it. ibsrpdm should return with exit code zero, if no error emerged.We should not create
async_ev_threadfor ibsrpdm.Fixes fd3005f0cd34 ("srp_daemon: Move the setup of the wakeup_pipe after openlog")Reviewed-by Bart Van Assche <[email protected]>Signed-off-by Honggang Li <[email protected]>--- srp_daemon/srp_daemon.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)srp_daemon/srp_daemon.c +5
-5@@ -1945,12 +1945,12 @@ static struct resources *alloc_res(void) run_thread_get_trap_notices, &res->res);if (ret) goto err; - } - ret =pthread_create (&res->res.async_ev_thread,NULL , - run_thread_listen_to_events, &res->res); -if (ret) - goto err; + ret =pthread_create (&res->res.async_ev_thread,NULL , + run_thread_listen_to_events, &res->res); +if (ret) + goto err; + }
Quoted 4 lines
srp_daemon/srp_daemon.c static struct resources *alloc_res(void) · line 1956
Quoted 2 lines
srp_daemon/srp_daemon.c +0
-0if (config->retry_timeout && !config->once) { ret = pthread_create(&res->res.reconnect_thread, NULL,Reviewed-by Nicolas Morey-Chaisemartin <[email protected]>Note: I will backport this to stable-v1[56] branches once its in master
I merged it two weeks before :)
https://github.com/linux-rdma/rdma-core/commit/3f58c9237533ed9d92f3d08cad56527299781862
Thanks
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html