[dm-devel] [PATCH v2] multipathd: release uxsocket and resource when cancel thread
Martin Wilck
mwilck at suse.com
Mon Jan 15 10:59:13 UTC 2018
On Mon, 2018-01-15 at 09:25 +0000, Wuchongyun wrote:
> Hi Martin,
> Thank you for your reply! Below is the new patch according to your
> comments, please help to review this patch, thanks.
Almost there :-)
+
> + pthread_mutex_lock(&client_lock);
> + list_for_each_entry_safe(client_loop, client_tmp, &clients,
> node) {
> + list_del_init(&client_loop->node);
> + close(client_loop->fd);
> + client_loop->fd = -1;
> + FREE(client_loop);
> + }
> + pthread_mutex_unlock(&client_lock);
>
For the sake of future code rework and avoiding code duplication, could
you please put the content in a function called __dead_client() (or
similar), place that function right before dead_client(), change
dead_client() to call it, and then call it from here as well?
Sorry, I should have suggested that in my first review already.
Martin
--
Dr. Martin Wilck <mwilck at suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
More information about the dm-devel
mailing list