From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C27C0A0032 for ; Fri, 18 Feb 2022 13:42:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD51041142; Fri, 18 Feb 2022 13:42:51 +0100 (CET) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mails.dpdk.org (Postfix) with ESMTP id D9EF641151 for ; Fri, 18 Feb 2022 13:42:50 +0100 (CET) Received: by mail-wm1-f43.google.com with SMTP id o34so5165193wms.1 for ; Fri, 18 Feb 2022 04:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/WquxM4JFULQIJzvKFnVGShFxCKIwtgOSbt8aKftOZQ=; b=WvU1zbPfs7Cah6eUYj8q7vrMi8BJofEHcl7CCo7OfLt+eblgE5n0hCfW0YOYE9yvKF cAi2xA1sjFCVIKylYm6toqyDH3kcSl5fwlC9Q636b4UWpu2R+lbtgriQDLKLD4yudI3c Xody2y++/cV7p7Z9EVKuvnEFXSf+r/96n2jztEc5NUmNQe/aLBRQeQwAddBfDmm8PWmy gsqPSneSM+khlyiwAT1ScW3olMZcCyXyFaldu7vpaXF2n18hL7gL8rGrBLzC0mKnqJr9 AxqbsDq3ExgHj1qWlGT9IFS+V3MQt1bMD2mdpcCTmTLsxVLBF80oDhOqbYP9OhnrF6+t 1M+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/WquxM4JFULQIJzvKFnVGShFxCKIwtgOSbt8aKftOZQ=; b=4CPZ0RCUZEetLRIwOIHa58Zhg2QvHJ5u3NSPCFBBG51Tzmcl/MuE9ZUzcjBf/k91r1 QcQ8c0mGmSfQRcVz8LZ+2x4KQoecLQqnj8AiLBLXxSYMk5ddOIEdgncPq9cB1TVVWePJ QSPDeGvikiel8lKwJSmJdr2nt71/UDvyya76NbH955qHNVz5bnhR1uO40yosu7KteUUu MIwQ79f71RHoYtYXUoWdRuZVooXXYADc1iNz6BvZusCna1nfkyqONsb/yBJZ9TeR3mjR A1cKKgTr2F3XA9PNFvExg5j/G3k2lFZuhGCLIMOVNem/nXrrjqNukczeyWwZ7ZBNxJSk uPfg== X-Gm-Message-State: AOAM532BYTfs2SquLW11LmNiDCFhO8brnInWqINqGmNj7Bb9DSrX/wE/ 4H7IDGNMmZI/gLQVUG4gm1I= X-Google-Smtp-Source: ABdhPJwni/peamybFggJbYVRLMChg7c1ulD1iYvN4c/b+An252SNBLfC5CVq5YkgBm7cQiBxRtlKJg== X-Received: by 2002:a05:600c:354c:b0:37b:ebb4:910b with SMTP id i12-20020a05600c354c00b0037bebb4910bmr11000040wmq.19.1645188170641; Fri, 18 Feb 2022 04:42:50 -0800 (PST) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id a10sm17003021wrt.59.2022.02.18.04.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:42:50 -0800 (PST) From: luca.boccassi@gmail.com To: Yunjian Wang Cc: Chenbo Xia , dpdk stable Subject: patch 'net/virtio-user: check FD flags getting failure' has been queued to stable release 20.11.5 Date: Fri, 18 Feb 2022 12:38:33 +0000 Message-Id: <20220218123931.1749595-64-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 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 Reviewed-by: Chenbo Xia --- 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@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)