coreutils
[Top][All Lists]
Advanced

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

Re: /proc/self/mountinfo versus chroot


From: Ruediger Meier
Subject: Re: /proc/self/mountinfo versus chroot
Date: Thu, 3 Mar 2016 09:51:30 +0100
User-agent: KMail/1.9.10

On Thursday 03 March 2016, Pc3a1draig Brady wrote:
> On 02/03/16 18:18, Rick Troth wrote:
> > Hi ...
> >
> > Thanks for your work supporting Gnu Coreutils, and _thanks
> > especially for signing the tarballs_. That's a major plus.
> >
> > Recently, someone (might have been you) put a lot of work into the
> > parsing of /proc/self/mountinfo in 'df'. But the result is not
> > always ideal: When running under 'chroot' (with /proc mounted)
> > /etc/mtab gets bypassed. (That's my test case. There might be
> > others.)
> >
> > I could offer a patch to provide some kind of switch, but not sure
> > how you or other Coreutils developers would want that handled. For
> > most of my builds, I would simply --disable-mountinfo or maybe
> > --enable-mtab or some such, a config time flag. What do you
> > recommend? (Coreutils is a big package and 'df' is just one
> > program.)
> >
> > Not sure when the mountinfo logic was added. I only noticed the
> > ignored /etc/mtab effect in Coreutils 8.24.
>
> CCing the mailing list.
>
> Ironically the preference for /proc/self/mountinfo was chosen
> to give more accurate info within chroots (and for bind mounts).
> The kernel has all the info, which is why we prefer that
> dynamically generated info.
>
> What inaccuracies are you seeing exactly?
> I do vaguely remember references to issues on some ubuntu kernels,
> so perhaps there is a kernel fix to provide better info?
>
> The change to use /proc/self/mountinfo was done in v8.24.
> As a hack to avoid it, you could use an LD_PRELOAD wrapper to return
> ENOENT for open("/proc/self/mountinfo"), along the lines of:
> http://git.sv.gnu.org/cgit/coreutils.git/tree/tests/df/no-mtab-status
>.sh?id=v8.24

FYI issues with /etc/mtab were also discussed recently on util-linux 
mailing list
http://www.spinics.net/lists/util-linux-ng/msg12386.html

cu,
Rudi




reply via email to

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