[dm-devel] [PATCH V4] multipathd: release uxsocket and resource when cancel thread

Martin Wilck mwilck at suse.com
Wed Jan 17 07:39:27 UTC 2018


Hi Wuchongyun,

another thing occured to me:

On Wed, 2018-01-17 at 02:33 +0000, Wuchongyun wrote:
>  
>  void uxsock_cleanup(void *arg)
>  {
> +	struct client *client_loop;
> +	struct client *client_tmp;
> +	int ux_sock = (int)arg;
> +
> +	pthread_mutex_lock(&client_lock);
> +	list_for_each_entry_safe(client_loop, client_tmp, &clients,
> node) {
> +		_dead_client(client_loop);
> +	}
> +	pthread_mutex_unlock(&client_lock);
> +
> +	close(ux_sock);
> +

Would it make sense to move the close(ux_sock) call further up
to avoid new clients trying to connect?

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