DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xie, Huawei" <huawei.xie@intel.com>
To: "Ouyang, Changchun" <changchun.ouyang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] librte_vhost: Fix the path test issue
Date: Thu, 6 Nov 2014 20:47:40 +0000	[thread overview]
Message-ID: <C37D651A908B024F974696C65296B57B0F2E3806@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <F52918179C57134FAEC9EA62FA2F9625118818BA@shsmsx102.ccr.corp.intel.com>



> -----Original Message-----
> From: Ouyang, Changchun
> Sent: Wednesday, November 05, 2014 10:20 PM
> To: Xie, Huawei; dev@dpdk.org
> Cc: Ouyang, Changchun
> Subject: RE: [dpdk-dev] [PATCH] librte_vhost: Fix the path test issue
> 
> Hi Huawei,
> 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
> >
> > >  		path = realpath(memfile, resolved_path);
> > > -		if (path == NULL) {
> > > +		if ((path == NULL) && (strlen(resolved_path) == 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.
> >
> > RETURN VALUE
> >        If there is no error, realpath() returns a pointer to the resolved_path.
> >
> >        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: Failed to find memory file for pid....

I did some investigation. This is due to that qemu unlink the file after it maps 
the huge page file. So this is a special case, it is ok we check the resolved path
when path is NULL if errno indicates "No such file or directory".
> 
> So I have to keep it.
> 
> Thanks again
> Changchun

  reply	other threads:[~2014-11-06 20:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03  8:11 Ouyang Changchun
2014-11-06  2:38 ` Xie, Huawei
2014-11-06  5:20   ` Ouyang, Changchun
2014-11-06 20:47     ` Xie, Huawei [this message]
2014-11-06 20:53 ` Xie, Huawei
2014-11-06 22:13   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C37D651A908B024F974696C65296B57B0F2E3806@SHSMSX101.ccr.corp.intel.com \
    --to=huawei.xie@intel.com \
    --cc=changchun.ouyang@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).