All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Brian Foster <bfoster@redhat.com>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH V2] xfsprogs: libxcmd/paths: make all comparisons using realpath'd paths
Date: Mon, 14 Jul 2014 09:11:22 -0500	[thread overview]
Message-ID: <53C3E50A.3020801@sandeen.net> (raw)
In-Reply-To: <20140714123430.GD14369@bfoster.bfoster>

On 7/14/14, 7:34 AM, Brian Foster wrote:
> On Fri, Jul 11, 2014 at 08:34:24PM -0500, Eric Sandeen wrote:
>> Both mountpoints and devices can be symlinks, so given a path
>> to look for, and mountpoints/devices from the system, use
>> realpath() on *everything* before making the comparison to see
>> if our path is a match.
>>
>> So, with symlinks for mount points as well as for devices:

<snip>

>> @@ -337,7 +350,7 @@ fs_table_initialise_mounts(
>>  {
>>  	struct statfs	*stats;
>>  	int		i, count, error, found;
>> -	char		*rpath = NULL;
>> +	char		*rpath = NULL, *rmntfromname= NULL, *rmntonname= NULL;
> 
> A couple missing spaces before '=' here.

whoopsies

> The fundamental change looks good, but the memory allocation handling
> seems a little ugly to me. A 'next:' label in the loop that frees the
> path buffers is cleaner IMO. Another option could be to put a couple
> PATH_MAX buffers on the stack or allocate them directly to also
> eliminate the realpath() return value assignment..?

Yeah, that probably makes more sense, thanks.

-eric


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2014-07-14 14:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-12  1:32 [PATCH] xfsprogs: libxcmd/paths: make all comparisons using realpath'd paths Eric Sandeen
2014-07-12  1:34 ` [PATCH V2] " Eric Sandeen
2014-07-14 12:34   ` Brian Foster
2014-07-14 14:11     ` Eric Sandeen [this message]
2014-07-14 21:21   ` [PATCH V3] " Eric Sandeen
2014-07-15 10:13     ` Christoph Hellwig

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=53C3E50A.3020801@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=bfoster@redhat.com \
    --cc=sandeen@redhat.com \
    --cc=xfs@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.