[PATCH v3] vhost: fix deadlock when message handling failed

Pei, Andy andy.pei at intel.com
Mon Jul 11 10:42:22 CEST 2022


HI ALL,

I see that in function vhost_user_msg_handler.
We use "ret" to store both vhost msg return code like "RTE_VHOST_MSG_RESULT_XXX" and function return value.
I wonder if it is better to use two different variable to make it easy to read.

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin at redhat.com>
> Sent: Tuesday, May 17, 2022 9:24 PM
> To: Ma, WenwuX <WenwuX.Ma at intel.com>; Xia, Chenbo
> <Chenbo.Xia at intel.com>; dev at dpdk.org
> Cc: Hu, Jiayu <Jiayu.Hu at intel.com>; Wang, Yinan <yinan.wang at intel.com>; He,
> Xingguang <xingguang.he at intel.com>; stable at dpdk.org
> Subject: Re: [PATCH v3] vhost: fix deadlock when message handling failed
> 
> 
> 
> On 5/7/22 15:27, Wenwu Ma wrote:
> > In vhost_user_msg_handler(), if vhost message handling failed, we
> > should check whether the queue is locked and release the lock before
> > returning. Or, it will cause a deadlock later.
> >
> > Fixes: 7f31d4ea05ca ("vhost: fix lock on device readiness
> > notification")
> > Cc: stable at dpdk.org
> >
> > Signed-off-by: Wenwu Ma <wenwux.ma at intel.com>
> > ---
> >   lib/vhost/vhost_user.c | 10 ++++++----
> >   1 file changed, 6 insertions(+), 4 deletions(-)
> >
> 
> Applied to dpdk-next-virtio/main.
> 
> Thanks,
> Maxime



More information about the stable mailing list