All of lore.kernel.org
 help / color / mirror / Atom feed
From: Isaac Dunham <ibid.ag@gmail.com>
To: Robby Workman <rworkman@slackware.com>
Cc: util-linux@vger.kernel.org, kzak@redhat.com
Subject: Re: v2.29 plan: kill mtab
Date: Mon, 11 Apr 2016 18:07:53 -0700	[thread overview]
Message-ID: <20160412010752.GA20359@newbook> (raw)
In-Reply-To: <alpine.LNX.2.02.1604071350320.22605@connie.slackware.com>

On Sun, Apr 10, 2016 at 09:35:41PM -0700, Robby Workman wrote:
> Karel Zak wrote:
> 
> > libmount supports three scenarios:
> > 
> > 1) regular classic /etc/mtab
> > 
> > 2) /etc/mtab symlink to /proc/self/mount -- in this case libmount uses
> >    /proc/self/mountinfo and /run/mount/utab
> > 
> > The current default is to detect symlink and on-the-fly switch
> > between 1) and 2).
> > 
> > 3) --enable-libmount-force-mountinfo -- don't care about the symlink
> >    and always use /proc/self/mountinfo. This is robust solution required
> >    for example by systemd, because unfortunately sometimes people use
> >    broken stuff (init scripts, tools, etc.) which removes the symlink.
> > 
> > 
> > I'd like to make 3) default, the question is what with mtab code:
> > 
> >    a) #ifdef all mtab code (and add --enable-libmount-support-mtab)
> > 
> >    b) remove mtab support at all (because it's evil and horrible code)
> > 
> > Comments?
> 
> 
> We still use SysV init because it suits our needs just fine, and we
> have no plans to migrate to systemd in the foreseeable future, so
> we don't have any other compelling reason to use anything other than
> classic /etc/mtab. As such, we'd certainly appreciate, at the very
> least, leaving the mtab support in util-linux.

Contrary to the implication of the mail you quote, whether to use mtab
is not primarily about systemd. Alpine Linux, the distro I use, uses
the /proc/mounts symlink; the userspace is Busybox/OpenRC with musl libc.

The main reason to use /proc/self/mountinfo is that it can be relied on
to tell you what filesystems are mounted where, even if you use chroots,
mount namespaces, private mounts, and similar things. This is because
the kernel necessarily needs to keep track of mounts on a per-process
basis. 
mtab can get confused by chroots and bind mounts, because /etc/mtab
is the userspace keeping track, manually, of the same information,
based on the assumptions that it's the only toolset doing mounts and
unmounts, that everything has the same mounts, and so on; essentially,
it's like keeping track of the number of people in a room by watching
who goes in or out.
Why would you bother counting people going through the door if you have
a window?
Why use code that poorly duplicates information the kernel *needs* to
have an accurate record of?



Thanks,
Isaac Dunham

  parent reply	other threads:[~2016-04-12  1:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11  4:35 v2.29 plan: kill mtab Robby Workman
2016-04-11 20:59 ` Karel Zak
2016-04-13  2:33   ` Robby Workman
2016-04-13 10:28     ` Karel Zak
2016-04-13 11:03     ` Ruediger Meier
2016-04-12  1:07 ` Isaac Dunham [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-04-07 10:54 Karel Zak
2016-04-07 11:22 ` Ruediger Meier
2016-04-13 20:58 ` Ruediger Meier
2016-04-14 12:43   ` Karel Zak

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=20160412010752.GA20359@newbook \
    --to=ibid.ag@gmail.com \
    --cc=kzak@redhat.com \
    --cc=rworkman@slackware.com \
    --cc=util-linux@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 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.