From: Alex Chen <alex.chen@huawei.com>
To: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Yuval Shaia <yuval.shaia.ml@gmail.com>, <mjt@tls.msk.ru>,
Laurent Vivier <laurent@vivier.eu>, <qemu-trivial@nongnu.org>,
<zhengchuan@huawei.com>, QEMU <qemu-devel@nongnu.org>,
<zhang.zhanghailiang@huawei.com>
Subject: Re: [PATCH] contrib/rdmacm-mux: Fix error condition in hash_tbl_search_fd_by_ifid()
Date: Tue, 24 Nov 2020 20:13:36 +0800 [thread overview]
Message-ID: <5FBCF8F0.9060103@huawei.com> (raw)
In-Reply-To: <CAC_L=vVg=YitEAKE+wGEmphuL8Eu87mYDiYD=UNKGhqOyd8PpQ@mail.gmail.com>
Hi everyone,
Who can help me merge this patch into the master branch? This patch may be need for qemu-5.2
Thanks,
Alex
On 2020/11/4 0:35, Marcel Apfelbaum wrote:
> Hi Alex,
>
> On Thu, Oct 29, 2020 at 3:43 PM AlexChen <alex.chen@huawei.com <mailto:alex.chen@huawei.com>> wrote:
>
> When fd is not found according to ifid, the _hash_tbl_search_fd_by_ifid()
> returns 0 and assigns the result to *fd, so We have to check that *fd is 0,
> not that fd is 0.
>
> Reported-by: Euler Robot <euler.robot@huawei.com <mailto:euler.robot@huawei.com>>
> Signed-off-by: AlexChen <alex.chen@huawei.com <mailto:alex.chen@huawei.com>>
> ---
> contrib/rdmacm-mux/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/rdmacm-mux/main.c b/contrib/rdmacm-mux/main.c
> index bd82abbad3..771ca01e03 100644
> --- a/contrib/rdmacm-mux/main.c
> +++ b/contrib/rdmacm-mux/main.c
> @@ -186,7 +186,7 @@ static int hash_tbl_search_fd_by_ifid(int *fd, __be64 *gid_ifid)
> *fd = _hash_tbl_search_fd_by_ifid(gid_ifid);
> pthread_rwlock_unlock(&server.lock);
>
> - if (!fd) {
> + if (!*fd) {
> syslog(LOG_WARNING, "Can't find matching for ifid 0x%llx\n", *gid_ifid);
> return -ENOENT;
> }
> --
> 2.19.1
>
>
> Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com <mailto:marcel.apfelbaum@gmail.com>>
>
> Thanks for the fix,
> Marcel
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Alex Chen <alex.chen@huawei.com>
To: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: zhang.zhanghailiang@huawei.com, qemu-trivial@nongnu.org,
mjt@tls.msk.ru, QEMU <qemu-devel@nongnu.org>,
Yuval Shaia <yuval.shaia.ml@gmail.com>,
zhengchuan@huawei.com, Laurent Vivier <laurent@vivier.eu>
Subject: Re: [PATCH] contrib/rdmacm-mux: Fix error condition in hash_tbl_search_fd_by_ifid()
Date: Tue, 24 Nov 2020 20:13:36 +0800 [thread overview]
Message-ID: <5FBCF8F0.9060103@huawei.com> (raw)
In-Reply-To: <CAC_L=vVg=YitEAKE+wGEmphuL8Eu87mYDiYD=UNKGhqOyd8PpQ@mail.gmail.com>
Hi everyone,
Who can help me merge this patch into the master branch? This patch may be need for qemu-5.2
Thanks,
Alex
On 2020/11/4 0:35, Marcel Apfelbaum wrote:
> Hi Alex,
>
> On Thu, Oct 29, 2020 at 3:43 PM AlexChen <alex.chen@huawei.com <mailto:alex.chen@huawei.com>> wrote:
>
> When fd is not found according to ifid, the _hash_tbl_search_fd_by_ifid()
> returns 0 and assigns the result to *fd, so We have to check that *fd is 0,
> not that fd is 0.
>
> Reported-by: Euler Robot <euler.robot@huawei.com <mailto:euler.robot@huawei.com>>
> Signed-off-by: AlexChen <alex.chen@huawei.com <mailto:alex.chen@huawei.com>>
> ---
> contrib/rdmacm-mux/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/rdmacm-mux/main.c b/contrib/rdmacm-mux/main.c
> index bd82abbad3..771ca01e03 100644
> --- a/contrib/rdmacm-mux/main.c
> +++ b/contrib/rdmacm-mux/main.c
> @@ -186,7 +186,7 @@ static int hash_tbl_search_fd_by_ifid(int *fd, __be64 *gid_ifid)
> *fd = _hash_tbl_search_fd_by_ifid(gid_ifid);
> pthread_rwlock_unlock(&server.lock);
>
> - if (!fd) {
> + if (!*fd) {
> syslog(LOG_WARNING, "Can't find matching for ifid 0x%llx\n", *gid_ifid);
> return -ENOENT;
> }
> --
> 2.19.1
>
>
> Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com <mailto:marcel.apfelbaum@gmail.com>>
>
> Thanks for the fix,
> Marcel
>
>
next prev parent reply other threads:[~2020-11-24 12:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-29 13:43 [PATCH] contrib/rdmacm-mux: Fix error condition in hash_tbl_search_fd_by_ifid() AlexChen
2020-10-29 13:43 ` AlexChen
2020-11-03 16:35 ` Marcel Apfelbaum
2020-11-03 16:35 ` Marcel Apfelbaum
2020-11-24 12:13 ` Alex Chen [this message]
2020-11-24 12:13 ` Alex Chen
2020-11-24 15:29 ` Peter Maydell
2020-11-24 15:29 ` Peter Maydell
2020-11-25 1:17 ` Alex Chen
2020-11-25 1:17 ` Alex Chen
2020-11-29 18:35 ` Marcel Apfelbaum
2020-11-29 18:35 ` Marcel Apfelbaum
2020-11-30 9:49 ` Alex Chen
2020-11-30 9:49 ` Alex Chen
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=5FBCF8F0.9060103@huawei.com \
--to=alex.chen@huawei.com \
--cc=laurent@vivier.eu \
--cc=marcel.apfelbaum@gmail.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=yuval.shaia.ml@gmail.com \
--cc=zhang.zhanghailiang@huawei.com \
--cc=zhengchuan@huawei.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.