* [rdma-core PATCH] srp_daemon: Don't create async_ev_thread if only run once
@ 2017-12-19 19:09 Honggang LI
[not found] ` <20171219190958.3189-1-honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Honggang LI @ 2017-12-19 19:09 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: honli-H+wXaHxf7aLQT0dZR+AlfA, Bart.VanAssche-Sjgp3cTcYWE,
jgg-uk2M96/98Pc
From: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
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.
Fixes: fd3005f0cd34 ("srp_daemon: Move the setup of the wakeup_pipe after openlog")
Reviewed-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
Signed-off-by: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
srp_daemon/srp_daemon.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index cec36db2..4012a7db 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -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,
--
2.14.2
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <20171219190958.3189-1-honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [rdma-core PATCH] srp_daemon: Don't create async_ev_thread if only run once [not found] ` <20171219190958.3189-1-honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2018-01-03 10:27 ` Nicolas Morey-Chaisemartin [not found] ` <ea3fe465-cc3b-1db3-e274-8c13f976953c-l3A5Bk7waGM@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Nicolas Morey-Chaisemartin @ 2018-01-03 10:27 UTC (permalink / raw) To: Honggang LI, linux-rdma-u79uwXL29TY76Z2rM5mHXA Cc: Bart.VanAssche-Sjgp3cTcYWE, jgg-uk2M96/98Pc, stable-Xl5UnYtxxKxKUA01WzcqbQ@public.gmane.org Le 19/12/2017 à 20:09, Honggang LI a écrit : > From: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > > 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. > > Fixes: fd3005f0cd34 ("srp_daemon: Move the setup of the wakeup_pipe after openlog") > Reviewed-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org> > Signed-off-by: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > --- > srp_daemon/srp_daemon.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c > index cec36db2..4012a7db 100644 > --- a/srp_daemon/srp_daemon.c > +++ b/srp_daemon/srp_daemon.c > @@ -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, Reviewed-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin-l3A5Bk7waGM@public.gmane.org> 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <ea3fe465-cc3b-1db3-e274-8c13f976953c-l3A5Bk7waGM@public.gmane.org>]
* Re: [rdma-core PATCH] srp_daemon: Don't create async_ev_thread if only run once [not found] ` <ea3fe465-cc3b-1db3-e274-8c13f976953c-l3A5Bk7waGM@public.gmane.org> @ 2018-01-03 14:19 ` Leon Romanovsky 0 siblings, 0 replies; 3+ messages in thread From: Leon Romanovsky @ 2018-01-03 14:19 UTC (permalink / raw) To: Nicolas Morey-Chaisemartin Cc: Honggang LI, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Bart.VanAssche-Sjgp3cTcYWE, jgg-uk2M96/98Pc, stable-Xl5UnYtxxKxKUA01WzcqbQ@public.gmane.org [-- Attachment #1: Type: text/plain, Size: 2294 bytes --] On Wed, Jan 03, 2018 at 11:27:27AM +0100, Nicolas Morey-Chaisemartin wrote: > > > Le 19/12/2017 à 20:09, Honggang LI a écrit : > > From: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > > > > 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. > > > > Fixes: fd3005f0cd34 ("srp_daemon: Move the setup of the wakeup_pipe after openlog") > > Reviewed-by: Bart Van Assche <bart.vanassche-Sjgp3cTcYWE@public.gmane.org> > > Signed-off-by: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > > --- > > srp_daemon/srp_daemon.c | 10 +++++----- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c > > index cec36db2..4012a7db 100644 > > --- a/srp_daemon/srp_daemon.c > > +++ b/srp_daemon/srp_daemon.c > > @@ -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, > Reviewed-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin-l3A5Bk7waGM@public.gmane.org> > 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 > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-03 14:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-19 19:09 [rdma-core PATCH] srp_daemon: Don't create async_ev_thread if only run once Honggang LI
[not found] ` <20171219190958.3189-1-honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-01-03 10:27 ` Nicolas Morey-Chaisemartin
[not found] ` <ea3fe465-cc3b-1db3-e274-8c13f976953c-l3A5Bk7waGM@public.gmane.org>
2018-01-03 14:19 ` Leon Romanovsky
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox