util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] libmount: dont ignore autofs mounts by default
@ 2023-03-13  1:42 Ian Kent
  2023-03-13  1:43 ` [PATCH 2/2] mount: ignore autofs entries in mount listing Ian Kent
  2023-03-15 14:32 ` [PATCH 1/2] libmount: dont ignore autofs mounts by default Karel Zak
  0 siblings, 2 replies; 5+ messages in thread
From: Ian Kent @ 2023-03-13  1:42 UTC (permalink / raw)
  To: util-linux; +Cc: fhirtz, John Westerdale, Frank Sorenson

Making libmount ingore autofs mounts by default can be a problem for
systemd, I remember now what the problem was.

autofs multi-mounts can be nested (and often are, think of a tree of
NFS exports) where there are autofs file system mounts within NFS
mounts and together with autofs mount triggers.

In this case systemd needs to see all the mounts at shutdown when it
is umounting the tree of mounts. We don't want to have to rely on
modifications having been made to systemd for this to work properly
so we can't make this the default behaviour in libmount.

Fixes: 22147e08c987 (libmount: use autofs mount hint to ignore autofs mount entries)
Signed-off-by: Ian Kent <raven@themaw.net>
Cc: John Westerdale <jwesterd@redhat.com>
Cc: Frank Hertz <fhirtz@redhat.com>
Cc: Frank Sorenson <fsorenso@redhat.com>
---
 libmount/src/context.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libmount/src/context.c b/libmount/src/context.c
index 8db6b6950..2df4716a7 100644
--- a/libmount/src/context.c
+++ b/libmount/src/context.c
@@ -75,7 +75,7 @@ struct libmnt_context *mnt_new_context(void)
 	/* if we're really root and aren't running setuid */
 	cxt->restricted = (uid_t) 0 == ruid && ruid == euid ? 0 : 1;
 
-	cxt->noautofs = 1;
+	cxt->noautofs = 0;
 
 	DBG(CXT, ul_debugobj(cxt, "----> allocate %s",
 				cxt->restricted ? "[RESTRICTED]" : ""));
@@ -164,7 +164,7 @@ int mnt_reset_context(struct libmnt_context *cxt)
 	cxt->helper = NULL;
 	cxt->mountdata = NULL;
 	cxt->flags = MNT_FL_DEFAULT;
-	cxt->noautofs = 1;
+	cxt->noautofs = 0;
 	cxt->has_selinux_opt = 0;
 
 	cxt->map_linux = mnt_get_builtin_optmap(MNT_LINUX_MAP);



^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH 0/2] Add ability to use autofs mount option hint to exclude mount table list entries
@ 2022-11-16  2:00 Ian Kent
  2022-11-16  2:00 ` [PATCH 2/2] mount: ignore autofs entries in mount listing Ian Kent
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Kent @ 2022-11-16  2:00 UTC (permalink / raw)
  To: util-linux; +Cc: Karel Zak, John Westerdale, fhirtz

Historically autofs mounts were not included in mount table listings.

This is the case in other SysV autofs implementations and was also
the case with Linux autofs until we changed to use the proc file system
for the mount table.

This often leads to considerable clutter for system administrators so
it's necessary to find a way to exclude these entries from mount table
listings without causing problems for sub-systems that may need the
entries to be present.

In other Unix autofs implementations we see this is done by including
a pseudo mount option that's used as a hint by applications that want
to exclude these entries.

There's further discussion of this in the first patch.

I started trying to do this quite a while ago, glibc, automount(8) and
the kernel have been updated to use such a mount option but, for some
reason, when I canme to update util-linux I thought it would cause
problems for systemd. But when I looked at what I had done just recently
I saw that isn't the case so I'm now continuing with this change.

What I've done might not be the prefered way to do this so any comments
are welcome so it can be done the way it fits best with util-linux.

Signed-off-by: Ian Kent <raven@themaw.net>
---

Ian Kent (2):
      libmount: use autofs mount hint to ignore autofs mount entries
      mount: ignore autofs entries in mount listing


 libmount/src/context.c     | 19 +++++++++++++++++++
 libmount/src/libmount.h.in |  2 ++
 libmount/src/libmount.sym  |  3 +++
 libmount/src/mountP.h      |  7 ++++++-
 libmount/src/tab_parse.c   | 33 +++++++++++++++++++++++++++++++++
 sys-utils/mount.c          |  2 ++
 6 files changed, 65 insertions(+), 1 deletion(-)

--
Ian


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

end of thread, other threads:[~2023-03-15 23:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-13  1:42 [PATCH 1/2] libmount: dont ignore autofs mounts by default Ian Kent
2023-03-13  1:43 ` [PATCH 2/2] mount: ignore autofs entries in mount listing Ian Kent
2023-03-15 14:32 ` [PATCH 1/2] libmount: dont ignore autofs mounts by default Karel Zak
2023-03-15 23:12   ` Ian Kent
  -- strict thread matches above, loose matches on Subject: below --
2022-11-16  2:00 [PATCH 0/2] Add ability to use autofs mount option hint to exclude mount table list entries Ian Kent
2022-11-16  2:00 ` [PATCH 2/2] mount: ignore autofs entries in mount listing Ian Kent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).