From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <anatoly.burakov@intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id F3A7A5920
 for <dev@dpdk.org>; Thu,  6 Dec 2018 12:18:19 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 06 Dec 2018 03:18:18 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.56,322,1539673200"; d="scan'208";a="125591940"
Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.252.12.22])
 ([10.252.12.22])
 by fmsmga004.fm.intel.com with ESMTP; 06 Dec 2018 03:18:17 -0800
To: Gao Feng <gfree.wind@vip.163.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Gao Feng <davidfgao@tencent.com>
References: <1544057251-17351-1-git-send-email-gfree.wind@vip.163.com>
 <0bd99be2-07e2-da13-23bb-9774ed470f90@intel.com>
 <7a174fb7.12d674.16782e7eafa.Coremail.gfree.wind@vip.163.com>
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
Message-ID: <c665ab4c-2d30-53b9-ff97-6d1b4c0f69eb@intel.com>
Date: Thu, 6 Dec 2018 11:18:17 +0000
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101
 Thunderbird/60.3.2
MIME-Version: 1.0
In-Reply-To: <7a174fb7.12d674.16782e7eafa.Coremail.gfree.wind@vip.163.com>
Content-Type: text/plain; charset=gbk; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH] eal: fix unlock in rte_eal_memzone_init
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, 06 Dec 2018 11:18:20 -0000

On 06-Dec-18 9:44 AM, Gao Feng wrote:
> At 2018-12-06 17:09:23, "Burakov, Anatoly" <anatoly.burakov@intel.com> 
> wrote:
> 
>>On 06-Dec-18 12:47 AM, gfree.wind@vip.163.com wrote:
>>> From: Gao Feng <davidfgao@tencent.com>
>>> 
>>> The RTE_PROC_PRIMARY error handler lost the unlock statement in the
>>> current codes. Now fix it.
>>> 
>>> Signed-off-by: Gao Feng <davidfgao@tencent.com>
>>
>>Fixes: 49df3db84883 ("memzone: replace memzone array with fbarray")
>>Cc: stable@dpdk.org
>>
>>> ---
>>>   lib/librte_eal/common/eal_common_memzone.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>> 
>>> diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c
>>> index b7081af..649cad4 100644
>>> --- a/lib/librte_eal/common/eal_common_memzone.c
>>> +++ b/lib/librte_eal/common/eal_common_memzone.c
>>> @@ -375,6 +375,7 @@
>>>   			rte_fbarray_init(&mcfg->memzones, "memzone",
>>>   			RTE_MAX_MEMZONE, sizeof(struct rte_memzone))) {
>>>   		RTE_LOG(ERR, EAL, "Cannot allocate memzone list\n");
>>> +		rte_rwlock_write_unlock(&mcfg->mlock);
>>>   		return -1;
>>>   	} else if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
>>>   			rte_fbarray_attach(&mcfg->memzones)) {
>>> 
>>
>>Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
>>
>>Although i would probably remove both unlocks and instead save and 
>  >return a value, so that unlock happens in one place. But this is OK too.
> 
>  > Thanks Anatoly.
> 
> Thanks Anatoly's review.
> I also prefer keep unlock in one place.
> As a new guy, finally I choose just a fix with a minor change. I would 
> do better next time.

That's OK. Regardless, you should resubmit it with proper Fixes: tag and 
a Cc: to stable, since this bug has been there since 18.05 and therefore 
our stable branches will benefit from your contribution as well.

> 
> And could I ask you one question, Anatoly?
> 
> I sent another dpdk patch with wrong git-send-email command, "git 
> send-email -1 --to dev@dpdk.org <mailto:dev@dpdk.org> patch_xxxx".
> As a result, it generated another wrong reply and email thread.
> 
> I don't know if i need to send v2 patch to correct it then?
> Its url is https://www.mail-archive.com/dev@dpdk.org/msg119925.html.

No need to do anything :)

> 
> Best Regards
> Feng
> 
>>
>>-- 
>>Thanks,
>>Anatoly
> 


-- 
Thanks,
Anatoly