From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50045.outbound.protection.outlook.com [40.107.5.45]) by dpdk.org (Postfix) with ESMTP id EA7B32C6A for ; Sun, 6 May 2018 08:06:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=E7BaRGRfboL1cz35GSDJX0Y9GvECQv7ixejbMGsdkoU=; b=TJKuiAKsSe5FBtdGKd0dGOGQwx4OkONpXYKzZDBaX++0vNqmAqMOP9PNoPqLIOskBBFekyd9/HjDdopGPWxasIGXM8CSFT3Qga7pYVbOT5T19rGyAwK9pD91OPhmBv+yod11h2OOx6IjiVTtuiiRwzOp9oQK+DeSBVcMk8lMLQM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (141.226.120.58) by AM6PR05MB4422.eurprd05.prod.outlook.com (2603:10a6:209:43::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.16; Sun, 6 May 2018 06:06:47 +0000 From: Shahaf Shuler To: bluca@debian.org Cc: stable@dpdk.org, nelio.laranjeiro@6wind.com, yskoh@mellanox.com, adrien.mazarguil@6wind.com, Xueming Li Date: Sun, 6 May 2018 09:05:45 +0300 Message-Id: <2e1a9e0d4186ca1785f009f4f7d13af660d8d392.1525586526.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [141.226.120.58] X-ClientProxiedBy: LO2P265CA0008.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::20) To AM6PR05MB4422.eurprd05.prod.outlook.com (2603:10a6:209:43::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4422; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 3:HGWTpVsuO9FDelM8AbYbd9DZZc0az58rwZbQPhhomf4ynBGYhxhXqQLwPRMz8BzOgf5JuvARbZM/RohK/OaHhgc5z2C5faxaF/g7d47UbyNNVByW5XB46Y79goySEZGoBU+/eFzwR5ve7xCxPZzQ6JKCkKsdCa2jwfMY0dqYYvfZCKnG0PLtGdY4zidVlquTZrEa8IzlUY6XoMgh5HfI80SrobugMxMmMXA2c+0UfiFmBQGbu6n1gcoB9JeY3rp/; 25:IKU+RE4GHWcFrWINtjcikGL2iAndrsYbNFImIwjORp7HJNHIRBZT9ysTWoB/ii2iehzQivn2uQv0HMkUv1oEDGNlP+KAelHQ4czl4SXxqwmc81eZdGEKQOnc/elVg3tz4yVZP08RC0q82uD2GoWhbkeRILSlOjiI0Z30+YjkFMf3OJNlC7F7/B7k37me4wuO5uAro1TpTm+2Ulkhh3k1xPKjO+RumfbULbrpSoCBMWv09pEyH/E8sJLGYj6Y+G9OUXoMGn7oRiyEgoLFmPtY8loRekRwZwxH0l2YHXTw6mc0tkVi9p7maREFmCITlkf4GTmxTHJuajqqWWB1xFA0fA==; 31:V/gZL63+0YafPKfW/2fKJXPIYKOBDlH8nbr9IfTh1/k+HHqg44mc/QtLcZkMUmsJU5bZ75IwS9xtGqis8eCnull1M1bwuzB166sMbbv4Vx+wXmip9NP2SGHpRvYXxGdTwLmidNT9O6ez0X32D7fYnMvtDfhYRfXQf3a4YUJUwbCmHs7kaoANtza2Ve1Ppx//Uzgxrw2hZQdzXUG7Tg0Le637Fx0skhm+DoZ0EM2Ml1E= X-MS-TrafficTypeDiagnostic: AM6PR05MB4422: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 20:VdaSic/1JDNAW300P2BSDUshwYJZlwZv+z+TUSrEBMlOLGXOiYz6DjaNYlYsre6FlShPQqnLI7aMqyjtoSDmik3DMPi4X4jwD4XsW5aqjvAkIoDtmtjMoJmL+Yv+8CVXeLvYFF86UjUud7tzuYzQHgtviCW0bNXpE3kIxV1vuGh0XksFTeZ+MExBVq7hZRyGTMiMcX+AkHRNDMt8lzVgSSXOCy1qEnUDR6Db1AiVnfwQ9MWuh+6/Jolng+ZVMfmsmchFkNJAfwUaXKpsQJeHNoTN6fm1LCyaBLvMGzpudAB6efPox0EaoyV6gysAdFqlriJkcr6ioSnwSW4pKxiMxnBVvM+pmBgwvlxQAZU00Zv2FF/676h/kRiWIAOO0+tjQ/5jirFgskdH1IRAW+nQCOgo9gEje76+oKaI//Gvqxycc7hE0n1HXLqaB8OreyvOmk+3B1kBW5guMAbEgr/HTRdN3+KTrrb095pL3xfIsICX+57AU/r6Hju+s2MHkWjO; 4:QMGU9L34fRHe4h8/PRE1hEJ1eE9sq45lNT2zwqB/f0qyL/hTIyQUiTsEieTQIzWRH2ciD+p+QgzJvitM6ZXc5CErMBN5N+MbiX5JxXEvtLsY6ULv3LqjuFegsXzn8gYaWzOrl4C1+MkMbbK8nEDJqGIvZ8zCS8vVVkZJvIFYkhtCSJGY854xnwnMLoD81A5IluMS1mhew+MKbKH5OjzMz1+mV9dqN/BEeViY5vHEvevpeb8/lpDmIjm9T6kPCanTlmWm9bX+SngscA288k5BZg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:AM6PR05MB4422; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4422; X-Forefront-PRVS: 06640999CA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39380400002)(396003)(346002)(39860400002)(189003)(199004)(105586002)(8676002)(16586007)(8936002)(316002)(2351001)(53936002)(86362001)(2361001)(6116002)(3846002)(106356001)(118296001)(66066001)(36756003)(47776003)(81156014)(55016002)(2906002)(50226002)(107886003)(4326008)(68736007)(305945005)(7736002)(81166006)(50466002)(25786009)(486006)(5660300001)(476003)(2616005)(48376002)(69596002)(16526019)(26005)(386003)(97736004)(956004)(186003)(478600001)(7696005)(52116002)(6916009)(21086003)(51416003)(446003)(11346002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4422; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR05MB4422; 23:/Jd6Tbr64EvYjEdYEXxgp0Z1IHsnKMMEMzTbybpE9?= =?us-ascii?Q?KbIEv+72ckhuwxoiJVNF5T2ygU16FeYXr6lkZ5qSeYCvmR0Zi4gBgIZm8R1s?= =?us-ascii?Q?lzPCaJJ7FiZZK7yiDnq1Cr7H/yL7NMtt+jQ5PH86qF6Hy6kdFI5QCpSN4WVj?= =?us-ascii?Q?D/dQHWb3w8F530b9UcTc8VEY2DrkN5Y78KFnCg5q2eirJZRnPRHZRNAC4bje?= =?us-ascii?Q?7hBFA67yKpPIiCZHZv8YpFmJkyqpCyfE7RteAmE7DEXZ+zv4I6Btk5m6KmQQ?= =?us-ascii?Q?x1TJBmuAa7IOa9wwMVa21vRQJk7QsMWF97ZNjnbGs5+/GcYhPXapVGdeOvWB?= =?us-ascii?Q?viap+NWNF/eo6DdsHvNj+pxdNhgtAQKTsLUaL1SpEPxS8w5GasblVkZGR5gu?= =?us-ascii?Q?IHa8t7mEBC/fLkiHGJNTqCKfkMdUIS9eUpzZHh9bosF4OXeiaN6GfH6VmXMg?= =?us-ascii?Q?/J4wPEMPMHYhBwFSIxzkvRokXLedFzjexqu/SbQ9suNFZAWJlQV5CVFEz0gd?= =?us-ascii?Q?oBqO13V1AUDibCPFcxyucJGLQIhWdDph1NPUVUuJGfqcYqtTEG1s6DEiaNPA?= =?us-ascii?Q?7bw7PMQUtfajhSGJXRd4nJwkkMhPVFMZywQbtHMxx5oB/WwWmoLet09LFt9X?= =?us-ascii?Q?TbPfGvRvoz1Y8ptcUKaxnESKW56GEI+orTHlaZW0IwDSt/vwNKMVYMvCk81g?= =?us-ascii?Q?0VgrGGoiEA5sNtr1qDSDFsUkO4+vQYFqJWQ0EcgpxqfTz5QMxheTk9lND5q2?= =?us-ascii?Q?pzKqakpH+G2KVVgXmDcCmU1/XzLjCemr0tCPFXXQtflb0hosiorByuoJCJCB?= =?us-ascii?Q?QCkHwmPA31WjciZ/uAwu7HqO3r80teU0azUnHZFTxrpfVCRSbfDapWr8beBc?= =?us-ascii?Q?Hg8MTQhz/UCpiRm9Vl1USMVo/ZORVB7Zxlr9P7ZFW32/6nXWQ0gI0J8jOBb+?= =?us-ascii?Q?40RcMG8ZhWRSmWhLPHiMhrhH/7VQQ+dQLlJ6gyTGATeVWBsitUUEqhea5kKg?= =?us-ascii?Q?Xa9rPyg2wtUJH3hjXPLx85ep/cLdY8KaJKabM/gkcLD6l+McopSE0B2T9r+g?= =?us-ascii?Q?WVh0CIhwPyhSs7fCyO/FLahR+VIbSwdElFILg/ChyED+kQ/5R8E0sp659AOV?= =?us-ascii?Q?Kf0OMR3bJgUxtxBZblgTtrfbdvhxhoFPVdjV7nxly+co0QyRgjcjtRfu0tuO?= =?us-ascii?Q?LI6YdPcWrXpNkrHW39GipplA/8TisEtSaA7TLAV3AT+AcCAWXwEUbxP69cXV?= =?us-ascii?Q?NNzoBoSJ8413itK3goMuTdRjgOR3wRboAIjyD/X?= X-Microsoft-Antispam-Message-Info: fnuq3MmBOX+MLfUexjmypPiX/QK3/5okOJHhb+MxVCO3dAJFohtz2xqBSLPs+M41+EivfLg1BetniANKp9u0Ge+If0I+pu86ET0sO1lr3GgSi1NUDJI4VVM/CWPT7L1UUOoETUY3LMSxjzF617QfdMawrxjMSHS65HSfd3IqaN/ynsLuuBuBSBkX80WX+/5j X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 6:HKTuGtze9ocmy6PcMnYM6kNMPu1wQrC2nKXkDnvK21phvgAzfMlJgOIFxuhyZuVVJ7IHZ70DEbxDA6+hIV6ECc+21uSHhWZacnNX/w8yG1yfpgOX0oeF5dkZHWkInFS5bUBW1oE6+i9bh6GeHEmO3Tj3esFMN7/CA/rz082XfVLNH+g40EJ8eULp7H5ronzRDBQqSKt6uOs7H3d+4x862ba8tFbb8JG2fUjzYGRQc41IvghiigVgQnJwbknCkNQhJvjMooaDddY++0Y6JquM1wiqBgwjowgjOwlg8OB7oCi6D1fRzN0K9hwHlRCOBAQQf87T9jtn1F1VHRYZ8vjiRz1L5MEb/LUenRQDZuJtJOYl3QoNFi/WxlFCWcYjqsfkk8em5UWdN/AKY1H+arJ9V74PqE/dGhNiI3BV2yc/Uk5ZaEt104moYVajD7uN7XlaFU9+YsqY8+xT3Ws1/IwAHw==; 5:Hetz8oBU9C+2Tao9+YVrSy5/W1epjghTGd+7r9dosYgjExouImeoCuSgezJxXxcwMazYX+Yg9apqrbKx0M1gYnE5gMGbuqVmZab4DwE0/ZFDMJ+UZOzMomD7xhjPF9KwQ4lBQHFeKyoNXQhml7C83vyZNO2/6tX+vibMMWGTCv0=; 24:rjK57XEnA4qsJwoFTRVEnxzBIiaxcvu2Udvct3QQTBraOAchm2K8RX/jDhNatjad99LcdY3VAyo7btGcVdILRRs0sCHZj+X5z1rDVCP9g9I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4422; 7:8T8IL0ZAywIG+s5LDu0vLmnyghxGHqlBguXPwJPRkoxvCE52jRHFzWwzmO+k0r69EZcCT1Z/MMHc6/VaBFtG6xjEiUFKXJB6kVhApyfddhdoTlM+BEoEZk+MzVjOZHC2d+2xQGFHiZ3K8JVEHgDI8/ZoMEOOILeg/TrfyW9XRg6dM/vg2VuGP78G7OGLbVWTLVZatKuHXeFWxtyRVbqBqqgeDiBOt9BTHt3u6Y9LrFUuR+wOU36VBWO4yii3DzU+ X-MS-Office365-Filtering-Correlation-Id: 7b0134af-7ca4-4217-b1d5-08d5b3178d3f X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2018 06:06:47.1924 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b0134af-7ca4-4217-b1d5-08d5b3178d3f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4422 Subject: [dpdk-stable] [PATCH 16/33] net/mlx5: fix existing file removal 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: Sun, 06 May 2018 06:06:49 -0000 From: Xueming Li [ 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") Cc: stable@dpdk.org 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 6e2d971c76..1c85f1ec95 100644 --- a/drivers/net/mlx5/mlx5_socket.c +++ b/drivers/net/mlx5/mlx5_socket.c @@ -33,7 +33,6 @@ mlx5_socket_init(struct rte_eth_dev *dev) }; int ret; int flags; - struct stat file_stat; /* * Initialise the socket to communicate with the secondary @@ -58,9 +57,7 @@ mlx5_socket_init(struct rte_eth_dev *dev) } 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.12.0