Skip to contentSkip to conversation

srp_daemon: Remove duplicate sync_res shutdown

PATCH Superseded Jason Gunthorpe 2 participants 2 messages Dec 19, 2017 1 message not in the archive InfiniBand

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 srp_daemon: Remove duplicate sync_res shutdown

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.

---
 srp_daemon/srp_daemon.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

v2:
Remove the assert too

srp_daemon/srp_daemon.c +1 -7
index cec36db2e0f12e..696c58bfd0b1ec 100644
@@ -1899,7 +1899,7 @@ static void free_res(struct resources *res)
 		pthread_join(res->trap_thread, &status);
 	}
 	if (res->sync_res)
-		sync_resources_cleanup(res->sync_res);
+	f	sync_resources_cleanup(res->sync_res);
 	if (res->ud_res)
 		ud_resources_destroy(res->ud_res);
 	if (res->umad_res)
@@ -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();
Signature · 6 lines
2.15.1

--
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): 20171219213800.GA28378-uk2M96/[email protected]

#2 lore raw

T24gVHVlLCAyMDE3LTEyLTE5IGF0IDE0OjM4IC0wNzAwLCBKYXNvbiBHdW50aG9ycGUgd3JvdGU6 DQo+IC0JCXN5bmNfcmVzb3VyY2VzX2NsZWFudXAocmVzLT5zeW5jX3Jlcyk7DQo+ICsJZglzeW5j X3Jlc291cmNlc19jbGVhbnVwKHJlcy0+c3luY19yZXMpOw0KDQpUaGlzIGxvb2tzIGxpa2UgYW4g dW5pbnRlbmRlZCBjaGFuZ2U/DQoNCkJhcnQuDQoNCg==
--
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