* [PATCH v3 rdma-core] srp_daemon: Remove duplicate sync_res shutdown
@ 2017-12-19 21:51 Jason Gunthorpe
[not found] ` <20171219215102.GA28841-uk2M96/98Pc@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2017-12-19 21:51 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
The very first thing free_res does is the same lock/signal/unlock
sequence, so there is no reason to open code it before calling
free_res.
res->sync_res always exists at this point so remove the assert too.
Signed-off-by: Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
srp_daemon/srp_daemon.c | 6 ------
1 file changed, 6 deletions(-)
v3:
- Delete stray edit
Bart, Yes, must have been a stray editor edit, I did not even look at v2 in
the mailer before sending it, since the one line change was so simple :(
This one compiles.
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index cec36db2e0f12e..5995e6a6173046 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -2073,12 +2073,6 @@ static int ibsrpdm(int argc, char *argv[])
if (ret)
pr_err("Querying SRP targets failed\n");
- assert(res->sync_res);
- pthread_mutex_lock(&res->sync_res->retry_mutex);
- res->sync_res->stop_threads = 1;
- pthread_cond_signal(&res->sync_res->retry_cond);
- pthread_mutex_unlock(&res->sync_res->retry_mutex);
-
free_res(res);
umad_done:
umad_done();
--
2.15.1
--
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] 4+ messages in thread
* Re: [PATCH v3 rdma-core] srp_daemon: Remove duplicate sync_res shutdown
[not found] ` <20171219215102.GA28841-uk2M96/98Pc@public.gmane.org>
@ 2017-12-19 22:18 ` Bart Van Assche
2017-12-20 7:20 ` Honggang LI
2017-12-25 10:31 ` Leon Romanovsky
2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2017-12-19 22:18 UTC (permalink / raw)
To: jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Tue, 2017-12-19 at 14:51 -0700, Jason Gunthorpe wrote:
> The very first thing free_res does is the same lock/signal/unlock
> sequence, so there is no reason to open code it before calling
> free_res.
>
> res->sync_res always exists at this point so remove the assert too.
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 rdma-core] srp_daemon: Remove duplicate sync_res shutdown
[not found] ` <20171219215102.GA28841-uk2M96/98Pc@public.gmane.org>
2017-12-19 22:18 ` Bart Van Assche
@ 2017-12-20 7:20 ` Honggang LI
2017-12-25 10:31 ` Leon Romanovsky
2 siblings, 0 replies; 4+ messages in thread
From: Honggang LI @ 2017-12-20 7:20 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
On Tue, Dec 19, 2017 at 02:51:02PM -0700, Jason Gunthorpe wrote:
> The very first thing free_res does is the same lock/signal/unlock
> sequence, so there is no reason to open code it before calling
> free_res.
>
> res->sync_res always exists at this point so remove the assert too.
>
> Signed-off-by: Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> srp_daemon/srp_daemon.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> v3:
> - Delete stray edit
>
> Bart, Yes, must have been a stray editor edit, I did not even look at v2 in
> the mailer before sending it, since the one line change was so simple :(
> This one compiles.
>
> diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
> index cec36db2e0f12e..5995e6a6173046 100644
> --- a/srp_daemon/srp_daemon.c
> +++ b/srp_daemon/srp_daemon.c
> @@ -2073,12 +2073,6 @@ static int ibsrpdm(int argc, char *argv[])
> if (ret)
> pr_err("Querying SRP targets failed\n");
>
> - assert(res->sync_res);
> - pthread_mutex_lock(&res->sync_res->retry_mutex);
> - res->sync_res->stop_threads = 1;
> - pthread_cond_signal(&res->sync_res->retry_cond);
> - pthread_mutex_unlock(&res->sync_res->retry_mutex);
> -
> free_res(res);
> umad_done:
> umad_done();
Reviewed-by: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 rdma-core] srp_daemon: Remove duplicate sync_res shutdown
[not found] ` <20171219215102.GA28841-uk2M96/98Pc@public.gmane.org>
2017-12-19 22:18 ` Bart Van Assche
2017-12-20 7:20 ` Honggang LI
@ 2017-12-25 10:31 ` Leon Romanovsky
2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2017-12-25 10:31 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 460 bytes --]
On Tue, Dec 19, 2017 at 02:51:02PM -0700, Jason Gunthorpe wrote:
> The very first thing free_res does is the same lock/signal/unlock
> sequence, so there is no reason to open code it before calling
> free_res.
>
> res->sync_res always exists at this point so remove the assert too.
>
> Signed-off-by: Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> srp_daemon/srp_daemon.c | 6 ------
> 1 file changed, 6 deletions(-)
>
Thanks, applied
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-25 10:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-19 21:51 [PATCH v3 rdma-core] srp_daemon: Remove duplicate sync_res shutdown Jason Gunthorpe
[not found] ` <20171219215102.GA28841-uk2M96/98Pc@public.gmane.org>
2017-12-19 22:18 ` Bart Van Assche
2017-12-20 7:20 ` Honggang LI
2017-12-25 10:31 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox