From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 0F5FDDED for ; Mon, 30 Apr 2018 16:08:04 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id v15-v6so8168050wrm.10 for ; Mon, 30 Apr 2018 07:08:04 -0700 (PDT) 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; bh=PAlewh9SQxN/BphEbaqHHWyeyG3UHaG5Cy8fbZh0kEw=; b=Cmw8n7xg2NpCmzHaSNEHmkQ9fjdfGxBQHPpfuUOmCPAuu4cwBQ2tMOXa0XESkWWopT FXeFOl/JjPrjEvNy7aFtR+uuAR3KKDIvH1ojUDAUbo7wQxPvp5RFvfhs7PzHIOT+xJ+3 bTbTNd7wvcIlazTaaKr4KaHp+AogV9xnM9G7R0xFDZJscFLWQJHaSlkI3AVTivOc3To+ cggLP+MH4BQOmyQZT+iJ6uO0EsBijvY8dpcweApfhCEyzKfIGOHwiCr80kM45PDLeyAO 8oo1dHVpbqllD1y4DLSIASZv5tZztTOlRXJ0pgdqYAXja0mxxXbfybYZ8+C7kPE41XLI SBPQ== 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; bh=PAlewh9SQxN/BphEbaqHHWyeyG3UHaG5Cy8fbZh0kEw=; b=l3WflbdZRoqflyuNWMYv87ml4OTG7yfjtXybvkceYEEZzaFdG1ejB5KK84lx+qcH22 Jtuep0w7eGSNgIn+MSHqLiBt9eHwWTOItLd7KUwQBabvBjH2im6ekkii95pZNbIjw5z7 oj6QUjgy60YEDtjg0ObGn3T50icxaZbMQKdEgjrTbNTTQDoFOLyvTqtxYjD0bMyJJaSr 2r86D8B7Vfhdze34AiZp9cSul0S9eSsyJS1OltrL52z3+Bde79Y9oYSm7JJwWA07Q9ZM 9zg+7JwB6DpOPDfdFiSgb41ZBd9Z8vmsPnqq5pHJgyC98TwwympEAYP/keh6TODg6IjA yUdQ== X-Gm-Message-State: ALQs6tCsJId4BTicMDHEXDVQB1G3ZXm+cup+AstWQNYjcKzdVkocRpbv DCyy5rbpP+3KUFHHupx+yy4fkWU/EYs= X-Google-Smtp-Source: AB8JxZqsrqOLdc5kKI52PRk/8Kvyp+I0zg/cmqGMc6rA7mnWRdp8I0urYhNavfX7fPiZceoGQpFmlw== X-Received: by 2002:adf:972c:: with SMTP id r41-v6mr9713431wrb.79.1525097283763; Mon, 30 Apr 2018 07:08:03 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id k28-v6sm3600217wrk.46.2018.04.30.07.08.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:08:02 -0700 (PDT) From: luca.boccassi@gmail.com To: Xueming Li Cc: Nelio Laranjeiro , dpdk stable Date: Mon, 30 Apr 2018 15:03:41 +0100 Message-Id: <20180430140606.4615-63-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430140606.4615-1-luca.boccassi@gmail.com> References: <20180430140606.4615-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'net/mlx5: fix existing file removal' has been queued to stable release 18.02.2 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: , X-List-Received-Date: Mon, 30 Apr 2018 14:08:04 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From c338fd6c80c6220b1af8b1c45fc2ee3f4f1626de Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Fri, 16 Mar 2018 23:22:27 +0800 Subject: [PATCH] net/mlx5: fix existing file removal [ upstream commit be939f60f42673eaa99609ea2c9f876e29320eff ] There is no guarantee that the file won't be removed by external user/application between the stat() and remove() syscalls, remove() will fail if the file no longer exists. Fixes: f8b9a3bad467 ("net/mlx5: install a socket to exchange a file descriptor") Signed-off-by: Xueming Li Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_socket.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_socket.c b/drivers/net/mlx5/mlx5_socket.c index 61c1a4a50..fb80fb3d1 100644 --- a/drivers/net/mlx5/mlx5_socket.c +++ b/drivers/net/mlx5/mlx5_socket.c @@ -32,7 +32,6 @@ priv_socket_init(struct priv *priv) }; int ret; int flags; - struct stat file_stat; /* * Initialise the socket to communicate with the secondary @@ -52,9 +51,7 @@ priv_socket_init(struct priv *priv) goto out; snprintf(sun.sun_path, sizeof(sun.sun_path), "/var/tmp/%s_%d", MLX5_DRIVER_NAME, priv->primary_socket); - ret = stat(sun.sun_path, &file_stat); - if (!ret) - claim_zero(remove(sun.sun_path)); + remove(sun.sun_path); ret = bind(priv->primary_socket, (const struct sockaddr *)&sun, sizeof(sun)); if (ret < 0) { -- 2.14.2