]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: use x-systemd options as X-*
authorKarel Zak <kzak@redhat.com>
Thu, 8 Dec 2016 13:29:44 +0000 (14:29 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 8 Dec 2016 14:27:24 +0000 (15:27 +0100)
The previous patch introduces X-* options namespace for options
that have to be maintained in user space.

Unfortunately, systemd users already use mount options that are
necessary by umount or another operations. The conclusion from
discussion with systemd guys is to store all the systemd options
in userspace.

It seems better to add one line exception to libmount than force all
fstab users to rename x-systemd to X-systemd.

Addresses: https://github.com/systemd/systemd/pull/3904
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
libmount/src/optmap.c
sys-utils/mount.8

index 08e06ffab2e7dda747736c5e60806a1ebcffc64d..e0240b322e15fefeaba3769112959615f2082055 100644 (file)
@@ -1971,6 +1971,7 @@ AS_IF([test "x$with_systemd" != xno], [
       [AC_MSG_ERROR([systemd expected but libsystemd not found])],
     [*:yes],
        AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available])
+       AC_DEFINE([HAVE_SYSTEMD], [1], [Define if systemd should be supported])
   )
 ])
 AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = xyes])
index 6fdaa7a414144d2bc38aa3c189b781080065b28d..114eb994e9eadf6d0fa2b420c186790096967a40 100644 (file)
@@ -160,6 +160,13 @@ static const struct libmnt_optmap userspace_opts_map[] =
 
    { "comment=", MNT_MS_COMMENT, MNT_NOHLPS | MNT_NOMTAB },/* fstab comment only */
 
+   /*
+    * systemd assumes that x-systemd options namespace is available for umount,
+    * let's use the options as X-*
+    */
+#ifdef HAVE_SYSTEMD
+   { "x-systemd", MNT_MS_XPERSIST, MNT_NOHLPS | MNT_PREFIX },           /* like X-* */
+#endif
    { "X-",      MNT_MS_XPERSIST, MNT_NOHLPS | MNT_PREFIX },              /* X- persistent comments (utab) */
    { "x-",      MNT_MS_XCOMMENT, MNT_NOHLPS | MNT_NOMTAB | MNT_PREFIX }, /* x- fstab only comments */
 
index 7f45ca7db37f65d7d8c3c0bc6be41e32702b3139..36e7ce6500fcf2890c6e19737275c7585d188ce3 100644 (file)
@@ -1154,6 +1154,10 @@ that maintain mount options in user space is a bad idea, because it's necessary
 to link all tools that use the options with libmount and there is no guarantee that the
 options will be always available (for example after a move mount operation or in
 unshared namespace).
+
+Note that x-systemd mount options are maintained as X-* options, the rename is
+unnecessary to keep existing fstab settings backwardly compatible.
+
 .TP
 .BR x-mount.mkdir [ = \fImode\fR ]
 Allow to make a target directory (mountpoint).  The optional argument