From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <aburakov@ecsmtp.ir.intel.com>
Received: from mga18.intel.com (mga18.intel.com [134.134.136.126])
 by dpdk.org (Postfix) with ESMTP id 0564F2C38;
 Thu, 23 Aug 2018 18:59:58 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga007.fm.intel.com ([10.253.24.52])
 by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 23 Aug 2018 09:59:58 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.53,278,1531810800"; d="scan'208";a="64676723"
Received: from irvmail001.ir.intel.com ([163.33.26.43])
 by fmsmga007.fm.intel.com with ESMTP; 23 Aug 2018 09:59:56 -0700
Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com
 [10.237.217.45])
 by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id
 w7NGxtAD025427; Thu, 23 Aug 2018 17:59:55 +0100
Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1])
 by sivswdev01.ir.intel.com with ESMTP id w7NGxtCS006689;
 Thu, 23 Aug 2018 17:59:55 +0100
Received: (from aburakov@localhost)
 by sivswdev01.ir.intel.com with LOCAL id w7NGxtUx006685;
 Thu, 23 Aug 2018 17:59:55 +0100
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: tiwei.bie@intel.com, ray.kinsella@intel.com, zhihong.wang@intel.com,
 maxime.coquelin@redhat.com, kuralamudhan.ramakrishnan@intel.com,
 stable@dpdk.org
Date: Thu, 23 Aug 2018 17:59:48 +0100
Message-Id: <e23e16fdb2e7a8ac527203401e177d6ae37eeb3c.1535041359.git.anatoly.burakov@intel.com>
X-Mailer: git-send-email 1.7.0.7
In-Reply-To: <cover.1535041359.git.anatoly.burakov@intel.com>
References: <cover.1535041359.git.anatoly.burakov@intel.com>
In-Reply-To: <cover.1535041359.git.anatoly.burakov@intel.com>
References: <cover.1535041359.git.anatoly.burakov@intel.com>
Subject: [dpdk-dev] [PATCH 1/8] fbarray: fix detach in noshconf mode
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Aug 2018 16:59:59 -0000

In noshconf mode, no shared files are created, but we're still trying
to unlink them, resulting in detach/destroy failure even though it
should have succeeded. Fix it by exiting early in noshconf mode.

Fixes: 3ee2cde248a7 ("fbarray: support --no-shconf mode")
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/eal_common_fbarray.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c
index 43caf3ced..ba6c4ae39 100644
--- a/lib/librte_eal/common/eal_common_fbarray.c
+++ b/lib/librte_eal/common/eal_common_fbarray.c
@@ -878,6 +878,10 @@ rte_fbarray_destroy(struct rte_fbarray *arr)
 	if (ret)
 		return ret;
 
+	/* with no shconf, there were never any files to begin with */
+	if (internal_config.no_shconf)
+		return 0;
+
 	/* try deleting the file */
 	eal_get_fbarray_path(path, sizeof(path), arr->name);
 
-- 
2.17.1