linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Malahal Naineni <malahal@us.ibm.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/1] umount.nfs: normalize path names during umounts.
Date: Mon, 5 Mar 2012 15:30:05 -0600	[thread overview]
Message-ID: <20120305213005.GB21904@us.ibm.com> (raw)
In-Reply-To: <20120305212015.GA21904@us.ibm.com>

Malahal Naineni [malahal@us.ibm.com] wrote:
> >  		while (pmc->m.mnt_fsname[nlen - 1] == '/')
> >  			nlen--;
> > -		if (strncmp(pmc->m.mnt_fsname, mc->m.mnt_fsname, nlen) != 0)
> > -			continue;
> > +		/*
> > +		 * When the mtab and /proc/mounts are not the same
> > +		 * file, normalize the path in the mtab if needed.
> > +		 */
> > +		if (mtab_is_writable())
> > +			normpath = normalize_path(mc->m.mnt_fsname);
> > +
> > +		if (strncmp(pmc->m.mnt_fsname, mc->m.mnt_fsname, nlen) != 0) {
> > +			/* Is there a normalized path, if so compare that one too */
> > +			if (normpath == NULL)
> > +				continue;
> > +			if (strncmp(pmc->m.mnt_fsname, normpath, nlen) != 0)
> > +				continue;
> 
> You need to free normpath here before the "continue".

Better yet, you don't need to normalize the path inside the loop. The
path you normalize doesn't change, so keep it outside "do while" loop.

Regards, Malahal.


  reply	other threads:[~2012-03-05 21:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 19:36 [PATCH 0/1] Normalized path names on umounts (take 2) Steve Dickson
2012-03-05 19:36 ` [PATCH 1/1] umount.nfs: normalize path names during umounts Steve Dickson
2012-03-05 21:20   ` Malahal Naineni
2012-03-05 21:30     ` Malahal Naineni [this message]
2012-03-06  0:28       ` Steve Dickson
2012-03-06  0:27     ` Steve Dickson
2012-03-06  0:31       ` Myklebust, Trond
2012-03-06  0:53         ` Steve Dickson
2012-03-06  1:04           ` Myklebust, Trond
2012-03-06  1:35             ` Steve Dickson
2012-03-06  1:52               ` Jim Rees
2012-03-06  2:25                 ` Malahal Naineni
2012-03-06  2:38                   ` Steve Dickson
2012-03-05 19:37 ` [PATCH 0/1] Normalized path names on umounts (take 2) Chuck Lever
2012-03-05 19:44   ` Steve Dickson

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=20120305213005.GB21904@us.ibm.com \
    --to=malahal@us.ibm.com \
    --cc=linux-nfs@vger.kernel.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).