patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Luca Boccassi <bluca@debian.org>, stable@dpdk.org
Cc: i.maximets@samsung.com
Subject: Re: [dpdk-stable] [PATCH 16.11] vhost-user: fix false negative in handling user messages
Date: Thu, 29 Nov 2018 09:49:10 +0100	[thread overview]
Message-ID: <9d9eddef-a1e0-1898-0597-9464e8414db0@redhat.com> (raw)
In-Reply-To: <20181128162054.8182-1-bluca@debian.org>



On 11/28/18 5:20 PM, Luca Boccassi wrote:
> vhost_user_msg_handler checks an accumulated return code before
> returning, and prints an error and returns -1 if it's non-zero.
> But some of the possible user messages cannot fail and thus do not
> set the variable, which might retain a previously set and unrelated
> value, causing unnecessary failures and error messages.
> 
> Reset the return code before use.
> 
> Fixes: 0ce9e73d1e8d ("vhost-user: drop connection on message handling failures")
> 
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> ---
> Found this issue when testing with the Vyatta stuff, "ret" is set at
> the beginning of the function and never reset when the message is for example
> VHOST_USER_GET_FEATURES so there's a flurry of errors.
> 
>   lib/librte_vhost/vhost_user.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index 00872c868..618d413fe 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -1087,6 +1087,7 @@ vhost_user_msg_handler(int vid, int fd)
>   
>   	}
>   
> +	ret = 0;
>   	switch (msg.request) {
>   	case VHOST_USER_GET_FEATURES:
>   		msg.payload.u64 = vhost_user_get_features();
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks!
Maxime

      parent reply	other threads:[~2018-11-29  8:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20181128162145epcas4p37815583a5bc1574c266eb8afb73d92c6@epcas4p3.samsung.com>
2018-11-28 16:20 ` Luca Boccassi
2018-11-29  7:58   ` Ilya Maximets
2018-11-29 10:45     ` Luca Boccassi
2018-11-29  8:49   ` Maxime Coquelin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d9eddef-a1e0-1898-0597-9464e8414db0@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=bluca@debian.org \
    --cc=i.maximets@samsung.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).