All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: v2.29 plan: kill mtab
@ 2016-04-11  4:35 Robby Workman
  2016-04-11 20:59 ` Karel Zak
  2016-04-12  1:07 ` Isaac Dunham
  0 siblings, 2 replies; 10+ messages in thread
From: Robby Workman @ 2016-04-11  4:35 UTC (permalink / raw)
  To: util-linux; +Cc: kzak

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.

-RW

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: v2.29 plan: kill mtab
  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-12  1:07 ` Isaac Dunham
  1 sibling, 1 reply; 10+ messages in thread
From: Karel Zak @ 2016-04-11 20:59 UTC (permalink / raw)
  To: Robby Workman; +Cc: util-linux

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.

This discussion is really not about init, but about mtab that is
broken by design. 

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: v2.29 plan: kill mtab
  2016-04-11  4:35 v2.29 plan: kill mtab Robby Workman
  2016-04-11 20:59 ` Karel Zak
@ 2016-04-12  1:07 ` Isaac Dunham
  1 sibling, 0 replies; 10+ messages in thread
From: Isaac Dunham @ 2016-04-12  1:07 UTC (permalink / raw)
  To: Robby Workman; +Cc: util-linux, kzak

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: v2.29 plan: kill mtab
  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
  0 siblings, 2 replies; 10+ messages in thread
From: Robby Workman @ 2016-04-13  2:33 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

On Mon, 11 Apr 2016, Karel Zak wrote:

> 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.
>
> This discussion is really not about init, but about mtab that is
> broken by design.


Okay, then how about this? Our current use of /etc/mtab works well
for us, and as far as I'm aware, we've experienced absolutely
none of this "[breakage] by design" - as such, we'd be grealy
appreciative if the option remains to continue using it.

-RW

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: v2.29 plan: kill mtab
  2016-04-13  2:33   ` Robby Workman
@ 2016-04-13 10:28     ` Karel Zak
  2016-04-13 11:03     ` Ruediger Meier
  1 sibling, 0 replies; 10+ messages in thread
From: Karel Zak @ 2016-04-13 10:28 UTC (permalink / raw)
  To: Robby Workman; +Cc: util-linux

On Tue, Apr 12, 2016 at 07:33:08PM -0700, Robby Workman wrote:
> > This discussion is really not about init, but about mtab that is
> > broken by design.
> 
> Okay, then how about this? Our current use of /etc/mtab works well

btw, mount(8) supports /etc/mtab -> /proc/mounts symlink for 20
years...

> for us, and as far as I'm aware, we've experienced absolutely
> none of this "[breakage] by design" - as such, we'd be grealy
> appreciative if the option remains to continue using it.

We're trying to be friendly to all Linux users ...so we're going to
#ifdef mtab stuff and keep --enable-libmount-support-mtab there for
the next years to keep you happy.

Maybe one day you will enter wonderful 21 century where we have 
Linux namespaces, containers, bind mounts, mount move operation,
chroots, btrfs, NFS and another cool stuff... and then you will see
that there is a fundamental difference between "what kernel thinks
about VFS" and "how users call mount(8)".

Fair enough?
    
   Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: v2.29 plan: kill mtab
  2016-04-13  2:33   ` Robby Workman
  2016-04-13 10:28     ` Karel Zak
@ 2016-04-13 11:03     ` Ruediger Meier
  1 sibling, 0 replies; 10+ messages in thread
From: Ruediger Meier @ 2016-04-13 11:03 UTC (permalink / raw)
  To: Robby Workman; +Cc: Karel Zak, util-linux

On Wednesday 13 April 2016, Robby Workman wrote:
> On Mon, 11 Apr 2016, Karel Zak wrote:
> > 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.
> >
> > This discussion is really not about init, but about mtab that is
> > broken by design.
>
> Okay, then how about this? Our current use of /etc/mtab works well
> for us, and as far as I'm aware, we've experienced absolutely
> none of this "[breakage] by design"

AFAIR we've had a lot of /etc/mtab related bugs in past, for sure also 
reproducable on Slackware. For util-linux upstream it's annyoing to fix 
these bugs by adding ugly code ... although there is a rock-solid 
replacement available since many years.

> - as such, we'd be grealy 
> appreciative if the option remains to continue using it.

There are many advantages by using /proc and unfixable issues 
with /etc/mtab file. IMHO in this case you should have a real reason 
why you don't want to go forward.

> -RW
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux"
> in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: v2.29 plan: kill mtab
  2016-04-13 20:58 ` Ruediger Meier
@ 2016-04-14 12:43   ` Karel Zak
  0 siblings, 0 replies; 10+ messages in thread
From: Karel Zak @ 2016-04-14 12:43 UTC (permalink / raw)
  To: Ruediger Meier; +Cc: util-linux

On Wed, Apr 13, 2016 at 10:58:28PM +0200, Ruediger Meier wrote:
> On Thursday 07 April 2016, 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?
> >
> >     Karel
> 
> 
> What about this first step:

I have applied another patch to disable mtab by default, a new 
configure option

    --enable-libmount-support-mtab 
    
is necessary to enable the original behavior.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: v2.29 plan: kill mtab
  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
  1 sibling, 1 reply; 10+ messages in thread
From: Ruediger Meier @ 2016-04-13 20:58 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

On Thursday 07 April 2016, 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?
>
>     Karel


What about this first step:

>From e6c17f35a8d63f129c5bbd722995b97d050e4151 Mon Sep 17 00:00:00 2001
From: Ruediger Meier <ruediger.meier@ga-group.nl>
Date: Wed, 13 Apr 2016 22:33:06 +0200
Subject: [PATCH] libmount: deprecate /etc/mtab file

Default is now --enable-libmount-force-mountinfo.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 31a1911..e4e6996 100644
--- a/configure.ac
+++ b/configure.ac
@@ -958,8 +958,8 @@ AC_SUBST([LIBMOUNT_VERSION_INFO])
 AC_DEFINE_UNQUOTED([LIBMOUNT_VERSION], ["$LIBMOUNT_VERSION"], [libmount version string])

 AC_ARG_ENABLE([libmount-force-mountinfo],
-  AS_HELP_STRING([--enable-libmount-force-mountinfo], [ignore /etc/mtab in all situations (recommended for systemd)]),
-  [], [enable_libmount_force_mountinfo=no]
+  AS_HELP_STRING([--disable-libmount-force-mountinfo], [use deprecated /etc/mtab file (not recommended and incompatible with openrc or systemd)]),
+  [], [enable_libmount_force_mountinfo=yes]
 )

 AS_IF([test "x$enable_libmount_force_mountinfo" == xyes], [
--
1.8.4.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: v2.29 plan: kill mtab
  2016-04-07 10:54 Karel Zak
@ 2016-04-07 11:22 ` Ruediger Meier
  2016-04-13 20:58 ` Ruediger Meier
  1 sibling, 0 replies; 10+ messages in thread
From: Ruediger Meier @ 2016-04-07 11:22 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

On Thursday 07 April 2016, 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-support-mtab)
>
>     b) remove mtab support at all (because it's evil and horrible
> code)
>
>  Comments?

Even if b) is the final goal I would first do a) and mark the new 
option --enable-support-mtab as deprecated from the beginning.

Could be interesting to see who would ever use this option and because 
of which reasons.

About changing the default: We could add a warning somewhere to a 
non-critical tool when printing human-readable output, like lsblk:
  "warning: deprecated /etc/mtab file ingnored"

... just to remind people to fix their system/scripts.

cu,
Rudi

^ permalink raw reply	[flat|nested] 10+ messages in thread

* v2.29 plan: kill mtab
@ 2016-04-07 10:54 Karel Zak
  2016-04-07 11:22 ` Ruediger Meier
  2016-04-13 20:58 ` Ruediger Meier
  0 siblings, 2 replies; 10+ messages in thread
From: Karel Zak @ 2016-04-07 10:54 UTC (permalink / raw)
  To: util-linux


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?

    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-04-14 12:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- 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

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.