util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Kent <raven@themaw.net>
To: util-linux <util-linux@vger.kernel.org>
Cc: fhirtz@redhat.com, John Westerdale <jwesterd@redhat.com>,
	Frank Sorenson <fsorenso@redhat.com>
Subject: [PATCH 1/2] libmount: dont ignore autofs mounts by default
Date: Mon, 13 Mar 2023 09:42:56 +0800	[thread overview]
Message-ID: <167867177635.35511.15003989525678735907.stgit@donald.themaw.net> (raw)

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);



             reply	other threads:[~2023-03-13  1:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13  1:42 Ian Kent [this message]
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

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=167867177635.35511.15003989525678735907.stgit@donald.themaw.net \
    --to=raven@themaw.net \
    --cc=fhirtz@redhat.com \
    --cc=fsorenso@redhat.com \
    --cc=jwesterd@redhat.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 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).