[sheepdog] [PATCH v2] sockfd_cache: close socket always when node is crashed

Liu Yuan namei.unix at gmail.com
Fri May 3 04:48:25 CEST 2013


On 05/03/2013 02:38 AM, MORITA Kazutaka wrote:
> void sheep_del_sockfd(const struct node_id *nid, struct sockfd *sfd)
>  {
> @@ -498,8 +520,7 @@ void sheep_del_sockfd(const struct node_id *nid, struct sockfd *sfd)
>  		return;
>  	}
>  
> -	sockfd_cache_put(nid, sfd->idx);
> -	sockfd_cache_del(nid);
> +	sockfd_cache_close(nid, sfd->idx);
>  	free(sfd);

No, we can't only close the fd. If !slots_all_free(), we don't remove
nid from the cache. We should inline close operation in
sockfd_cache_destroy().

Thanks,
Yuan



More information about the sheepdog mailing list