GNU bug report logs - #21372
df prioritizes some bind mounts over real ones.

Previous Next

Package: coreutils;

Reported by: Dave Chiluk <chiluk <at> canonical.com>

Date: Fri, 28 Aug 2015 21:09:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #61 received at 21372 <at> debbugs.gnu.org (full text, mbox):

From: Dave Chiluk <dave.chiluk <at> canonical.com>
To: Pádraig Brady <P <at> draigBrady.com>, 
 21372 <at> debbugs.gnu.org
Subject: Re: bug#21372: [PATCH v4] df: fix prioritize real mounts over bind
 mounts
Date: Wed, 23 Sep 2015 08:51:12 -0500
On 09/22/2015 05:47 PM, Pádraig Brady wrote:
> On 22/09/15 23:28, Dave Chiluk wrote:
>> The patch I just sent out broke existing behavior on non-linux again.
>> I'm really beginning to hate that if statement.  Anyhow, I fixed that,
>> and changed it around for readability.
> 
> 
>    bool target_nearer_device_root = ! (devlist->me->me_mntroot != NULL
>                                        && me->me_mntroot != NULL
>                                        && (strlen (devlist->me->me_mntroot)
>                                            < strlen(me->me_mntroot)));
> 
> While this is logically correct it's confusing
> as mntroot is related to the source, not the target.
> Also the >= implicit in the !< conflicts with "nearer",
> where "as_near_or_nearer" would be more accurate.
> That's why I kept the ! outside of the boolean.
> 
> I'll go with my orig naming unless there are major objections.
> 
> thanks,
> Pádraig.
> 

I was reading target as referring to the current me that is being
iterated on.  I still don't like the variable "source_below_root". This
implies to me that the source filesystem dir is below the root (i.e.
"/") of the filesystem, which obviously would not be possible.  How
about "longer_mntroot" or "source_longer_mntroot".  That way the later
logic reads
"target_nearer_root && ! source_longer_mntroot"

It's more explicit, and implies which variable within the mount_entry
that we care about.

I think at this point we're really just splitting hairs.

Dave.




This bug report was last modified 9 years and 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.