From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH] vhost: fix deadlock when vhost unregister Date: Thu, 21 Feb 2019 18:46:55 +0100 Message-ID: References: <20190128065549.98266-1-findtheonlyway@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: stable@dpdk.org To: sunwenjie , dev@dpdk.org Return-path: In-Reply-To: <20190128065549.98266-1-findtheonlyway@gmail.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 1/28/19 7:55 AM, sunwenjie wrote: > When rte_vhost_driver_unregister delete the connection fd, > fdset_try_del will always try and donot release the > vhostuser.mutex if the fd is busy, but the fdset_event_dispatch > will set the fd to busy and call vhost_user_msg_handler to get > vhostuser.mutex, which will cause deadlock. Unlock the > vhost_user.mutexif fdset_try_del fail and relock it when retry. > > Fixes: 8b4b949144b8 ("vhost: fix dead lock on closing in server mode") > Cc: stable@dpdk.org > > Signed-off-by: sunwenjie > --- > lib/librte_vhost/socket.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Applied to dpdk-next-virtio/master with suggested commit message rewording, and fixed Signed-off-by name. Thanks, Maxime