From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CD99EA0553 for ; Mon, 17 Feb 2020 18:47:01 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C50AE1DA12; Mon, 17 Feb 2020 18:47:01 +0100 (CET) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 8B9D31DA12 for ; Mon, 17 Feb 2020 18:47:00 +0100 (CET) Received: by mail-wm1-f67.google.com with SMTP id s10so190547wmh.3 for ; Mon, 17 Feb 2020 09:47:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mvUTdg+emBpJDg8+w9dUjfj+g/1rG5Y3zSGFdIsZuG8=; b=EeXdx0wme3H0OTX/yFx5EZh+317A6ptzpF9sJ6IUkBRoff+2WWhKfjNOjlwLUvLHqV myK4q7WNRCc4QjWa/+rKbz+987J1n8uWM2/Cx2oL0PRn9QVyQLLRsnPEdMBnk+0tQZWm 2hUNncAV4M2jP2q2Oi6rRLpKcrtE17N6F56vk3A64Rfwe+2M2u8RiSZryG2aA0Eaw9g1 lI8Q+3C68bYkTsqqaLJ6O1Gg+BeFyN/24odrmZO2Vax9fPCx10CAYJtANNiUbVL4mi8I RIq6xxOAvtj0sekiPVE0IhgU3deGnmgIT4FRrE9+8toRj7/A/z7fpbo/ba/mrNQlVp8d PYtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mvUTdg+emBpJDg8+w9dUjfj+g/1rG5Y3zSGFdIsZuG8=; b=kWJ0raHrgopw3IsCbdlewzUQ8R9eg4dLRZeoDpbXuSv98npz4cScolaJuWX+lk9qwb 0ul6W0IuNp6f9qiev+ywHLBUVQ0YeWIhrH4hvboPWvfAOzYkMk7BXOYBYVoJ6TfGWtfy XxifH91Co+z7GrEjDSFNV6on9Kth6ckPtP/d2dZEWUv8Pxi1QPsiABBtyBoNJ74h4VTY hgIUoHXxc7wcqU0syGefAaV+TxWnLteAo/znHIm48rQjCMYwvJfpklr8OWRbC7V81LZG y23L1CnaEN+3TvYMwYDYR6/ww6fOihhVadLyxqmoh8MBBNogubKhYRnYND7e7YBrVpNo KYCA== X-Gm-Message-State: APjAAAUTpv4ForWlD7Ov0LOOYuo5gtRh/IcG3D3eCbuHorAh2hi+IGZy /Xz5+F/AMJgR5+lf8WZEAog= X-Google-Smtp-Source: APXvYqxztk88zLg3M5gH8t9ASa/lkw2BfBZRI+hJFjLYL4NbOYGjj4R0QPuLLL+DOc7YV0h+bpqaYw== X-Received: by 2002:a7b:c652:: with SMTP id q18mr132947wmk.123.1581961620247; Mon, 17 Feb 2020 09:47:00 -0800 (PST) Received: from localhost (userh634.uk.uudial.com. [194.69.103.7]) by smtp.gmail.com with ESMTPSA id r6sm1908812wrp.95.2020.02.17.09.46.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 09:46:59 -0800 (PST) From: luca.boccassi@gmail.com To: Jin Yu Cc: Maxime Coquelin , dpdk stable Date: Mon, 17 Feb 2020 17:45:33 +0000 Message-Id: <20200217174546.25334-41-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200217174546.25334-1-luca.boccassi@gmail.com> References: <20200211112216.3929-190-luca.boccassi@gmail.com> <20200217174546.25334-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'examples/vhost_blk: fix check of device path' has been queued to stable release 19.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.1 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/19/20. 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. Thanks. Luca Boccassi --- >From e879627a3b3a5f2d90e2a0917bb3a61315090d5a Mon Sep 17 00:00:00 2001 From: Jin Yu Date: Wed, 12 Feb 2020 20:54:46 +0800 Subject: [PATCH] examples/vhost_blk: fix check of device path [ upstream commit 71dd2870bf79930ac388b50d70fc319dd200e604 ] Fix the time of check time of use warning in example code. Ignore the errno of unlink failure. There are two situations. The first one is that file doesn't exist the unlink fails and it's ok to ignore. The second one is that unlink fails to remove file but the next bind() would fail too. Coverity issue: 350589, 158663 Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample") Signed-off-by: Jin Yu Reviewed-by: Maxime Coquelin --- examples/vhost_blk/vhost_blk.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c index e1036bf3a6..74c82a900b 100644 --- a/examples/vhost_blk/vhost_blk.c +++ b/examples/vhost_blk/vhost_blk.c @@ -994,11 +994,7 @@ vhost_blk_ctrlr_construct(const char *ctrlr_name) } snprintf(dev_pathname, sizeof(dev_pathname), "%s/%s", path, ctrlr_name); - if (access(dev_pathname, F_OK) != -1) { - if (unlink(dev_pathname) != 0) - rte_exit(EXIT_FAILURE, "Cannot remove %s.\n", - dev_pathname); - } + unlink(dev_pathname); if (rte_vhost_driver_register(dev_pathname, 0) != 0) { fprintf(stderr, "socket %s already exists\n", dev_pathname); @@ -1041,8 +1037,7 @@ signal_handler(__rte_unused int signum) { struct vhost_blk_ctrlr *ctrlr; - if (access(dev_pathname, F_OK) == 0) - unlink(dev_pathname); + unlink(dev_pathname); if (g_should_stop != -1) { g_should_stop = 1; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-17 17:00:16.456848275 +0000 +++ 0041-examples-vhost_blk-fix-check-of-device-path.patch 2020-02-17 17:00:15.359951192 +0000 @@ -1,8 +1,10 @@ -From 71dd2870bf79930ac388b50d70fc319dd200e604 Mon Sep 17 00:00:00 2001 +From e879627a3b3a5f2d90e2a0917bb3a61315090d5a Mon Sep 17 00:00:00 2001 From: Jin Yu Date: Wed, 12 Feb 2020 20:54:46 +0800 Subject: [PATCH] examples/vhost_blk: fix check of device path +[ upstream commit 71dd2870bf79930ac388b50d70fc319dd200e604 ] + Fix the time of check time of use warning in example code. Ignore the errno of unlink failure. There are two situations. The first one is that file doesn't exist the unlink fails and @@ -11,7 +13,6 @@ Coverity issue: 350589, 158663 Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample") -Cc: stable@dpdk.org Signed-off-by: Jin Yu Reviewed-by: Maxime Coquelin