emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#19570: closed (bug: df and bind mounts)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#19570: closed (bug: df and bind mounts)
Date: Fri, 26 Jun 2015 17:30:04 +0000

Your message dated Fri, 26 Jun 2015 18:29:33 +0100
with message-id <address@hidden>
and subject line Re: bug#19570: bug: df and bind mounts
has caused the debbugs.gnu.org bug report #19570,
regarding bug: df and bind mounts
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
19570: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19570
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: bug: df and bind mounts Date: Mon, 12 Jan 2015 02:36:37 +0300
Hello,

I have an issue with df (both in version 8.23 and in master branch).

I have tmpfs mounted as /run . There is /run/cgs/httpd subdirectory in
/run (just a subdirectory, not a tmpfs or another mount). This
/run/cgs/httpd is bind-mounted to /usr/cgs/httpd/run.

The current algorithm in df.c:filter_mount_list() chooses the bind
mountpoint since it has the leading slash in the "device" name
("/run/cgs/httpd" vs "run") which is wrong in my setup.

The similar (but not the same) issue is fixed by commit:
http://git.savannah.gnu.org/cgit/coreutils.git/commit/src/df.c?id=ed1a495b3ccb2665a13229ca866f2115bd768d17

I guess the "let real devices with / in the name win" replacement branch
should only be applied if mountpoints are the same as well.

Below is the data to reproduce the bug.

=== /etc/mtab (partial) ===
run /run tmpfs rw,noatime,nodiratime,nodev,noexec,mode=0755,size=1m 0 0
/run/cgs/httpd /usr/cgs/httpd/run none rw,bind 0 0
======

=== Real output (git) ===
Filesystem      Size  Used Avail Use% Mounted on
/run/cgs/httpd  1.0M  8.0K 1016K   1% /usr/cgs/httpd/run
======

=== Expected output (with the attached patch applied) ===
Filesystem      Size  Used Avail Use% Mounted on
run             1.0M  8.0K 1016K   1% /run
======

-- 
Vladimir A. Pavlov

Attachment: coreutils-8.23-df_bindmount_fix.patch
Description: Source code patch


--- End Message ---
--- Begin Message --- Subject: Re: bug#19570: bug: df and bind mounts Date: Fri, 26 Jun 2015 18:29:33 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
On 12/01/15 01:31, Pádraig Brady wrote:
> On 11/01/15 23:36, Vladimir A. Pavlov wrote:
>> Hello,
>>
>> I have an issue with df (both in version 8.23 and in master branch).
>>
>> I have tmpfs mounted as /run . There is /run/cgs/httpd subdirectory in
>> /run (just a subdirectory, not a tmpfs or another mount). This
>> /run/cgs/httpd is bind-mounted to /usr/cgs/httpd/run.
>>
>> The current algorithm in df.c:filter_mount_list() chooses the bind
>> mountpoint since it has the leading slash in the "device" name
>> ("/run/cgs/httpd" vs "run") which is wrong in my setup.
>>
>> The similar (but not the same) issue is fixed by commit:
>> http://git.savannah.gnu.org/cgit/coreutils.git/commit/src/df.c?id=ed1a495b3ccb2665a13229ca866f2115bd768d17
>>
>> I guess the "let real devices with / in the name win" replacement branch
>> should only be applied if mountpoints are the same as well.
>>
>> Below is the data to reproduce the bug.
>>
>> === /etc/mtab (partial) ===
>> run /run tmpfs rw,noatime,nodiratime,nodev,noexec,mode=0755,size=1m 0 0
>> /run/cgs/httpd /usr/cgs/httpd/run none rw,bind 0 0
>> ======
>>
>> === Real output (git) ===
>> Filesystem      Size  Used Avail Use% Mounted on
>> /run/cgs/httpd  1.0M  8.0K 1016K   1% /usr/cgs/httpd/run
>> ======
>>
>> === Expected output (with the attached patch applied) ===
>> Filesystem      Size  Used Avail Use% Mounted on
>> run             1.0M  8.0K 1016K   1% /run
>> ======
>>
> 
> Thanks for the analysis and patch,
> Current tests pass at least with it.
> I'll analyse a little more, add tests and probably push.

df v8.24 will read /proc/self/mountinfo if available
and so won't hit this issue in practise as the
bind mount location won't be passed to, or presented by df.
I.E. the "Filesystem" for a particular device id will
not switch representations.

thanks,
Pádraig.



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]