From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A5F722E89 for ; Thu, 6 Nov 2014 06:11:12 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 05 Nov 2014 21:18:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,324,1413270000"; d="scan'208";a="603239171" Received: from pgsmsx103.gar.corp.intel.com ([10.221.44.82]) by orsmga001.jf.intel.com with ESMTP; 05 Nov 2014 21:20:35 -0800 Received: from pgsmsx102.gar.corp.intel.com (10.221.44.80) by PGSMSX103.gar.corp.intel.com (10.221.44.82) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 6 Nov 2014 13:20:13 +0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 6 Nov 2014 13:20:12 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.156]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.202]) with mapi id 14.03.0195.001; Thu, 6 Nov 2014 13:20:12 +0800 From: "Ouyang, Changchun" To: "Xie, Huawei" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] librte_vhost: Fix the path test issue Thread-Index: AQHP+WrAD5xnzvm0ykOzPcH44tHyHZxTCyjg Date: Thu, 6 Nov 2014 05:20:11 +0000 Message-ID: References: <1415002313-15661-1-git-send-email-changchun.ouyang@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] librte_vhost: Fix the path test issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 05:11:13 -0000 Hi Huawei,=20 Thanks for the comments, And my response as follows. > -----Original Message----- > From: Xie, Huawei > Sent: Thursday, November 6, 2014 10:39 AM > To: Ouyang, Changchun; dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] librte_vhost: Fix the path test issue >=20 > > path =3D realpath(memfile, resolved_path); > > - if (path =3D=3D NULL) { > > + if ((path =3D=3D NULL) && (strlen(resolved_path) =3D=3D 0)) { > > RTE_LOG(ERR, VHOST_CONFIG, > > "(%"PRIu64") Failed to resolve fd directory\n", > > dev->device_fh); > Changchun: > For some strange file, according to API description, we shouldn't check > resolved_path as it is undefined. > To make the loop go on, we could use "continue" when we detect path is > NULL. >=20 > RETURN VALUE > If there is no error, realpath() returns a pointer to the resolved= _path. >=20 > Otherwise it returns a NULL pointer, and the contents of the array > resolved_path are undefined, and errno is set to indicate the error. After my investigation this issue and find out using continue doesn't work. The reason is procmap.fname itself is "/dev/hugepages/qemu_back_mem.pc.ram.= zxfqLq", It is not a normal path, so in this case, path is null, while resolved-path= is /dev/hugepages/qemu_back_mem.pc.ram.zxfqLq If 'continue' is used, then procmap.fname could not be hit in the directory= list, And then app will exit after report:=1B$B!!=1B(BFailed to find memory file= for pid.... So I have to keep it. Thanks again Changchun