patch 'net/virtio-user: check FD flags getting failure' has been queued to stable release 20.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 18 13:38:33 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/20/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/d8090fd8c4bdc3415ff0ba312d62f9e5936e4248

Thanks.

Luca Boccassi

---
>From d8090fd8c4bdc3415ff0ba312d62f9e5936e4248 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Sat, 8 Jan 2022 15:52:31 +0800
Subject: [PATCH] net/virtio-user: check FD flags getting failure

[ upstream commit 6abf10a21b293cb427ef21c59f490592717cb211 ]

The function fcntl() could return errors,
the return value need to be checked.

Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
---
 drivers/net/virtio/virtio_user/vhost_user.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index 350eed4182..dba5368456 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -468,8 +468,10 @@ vhost_user_setup(struct virtio_user_dev *dev)
 	}
 
 	flag = fcntl(fd, F_GETFD);
-	if (fcntl(fd, F_SETFD, flag | FD_CLOEXEC) < 0)
-		PMD_DRV_LOG(WARNING, "fcntl failed, %s", strerror(errno));
+	if (flag == -1)
+		PMD_DRV_LOG(WARNING, "fcntl get fd failed, %s", strerror(errno));
+	else if (fcntl(fd, F_SETFD, flag | FD_CLOEXEC) < 0)
+		PMD_DRV_LOG(WARNING, "fcntl set fd failed, %s", strerror(errno));
 
 	memset(&un, 0, sizeof(un));
 	un.sun_family = AF_UNIX;
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-18 12:37:40.436134585 +0000
+++ 0064-net-virtio-user-check-FD-flags-getting-failure.patch	2022-02-18 12:37:37.702792189 +0000
@@ -1 +1 @@
-From 6abf10a21b293cb427ef21c59f490592717cb211 Mon Sep 17 00:00:00 2001
+From d8090fd8c4bdc3415ff0ba312d62f9e5936e4248 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6abf10a21b293cb427ef21c59f490592717cb211 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index cc830a660f..0a39393c45 100644
+index 350eed4182..dba5368456 100644
@@ -22 +23 @@
-@@ -840,8 +840,10 @@ vhost_user_setup(struct virtio_user_dev *dev)
+@@ -468,8 +468,10 @@ vhost_user_setup(struct virtio_user_dev *dev)


More information about the stable mailing list