util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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 1/2] libmount: use autofs mount hint to ignore autofs mount entries Ian Kent
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ 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] 10+ messages in thread

* [PATCH 1/2] libmount: use autofs mount hint to ignore autofs mount entries
  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 ` Ian Kent
  2022-11-23  9:56   ` Karel Zak
  2022-11-16  2:00 ` [PATCH 2/2] mount: ignore autofs entries in mount listing Ian Kent
  2022-11-23  9:51 ` [PATCH 0/2] Add ability to use autofs mount option hint to exclude mount table list entries Karel Zak
  2 siblings, 1 reply; 10+ 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.

But now that /etc/mtab is a symlink to the proc filesystem mount
table the autofs mount entries appear in the mount table on Linux.

Prior to the symlinking of /etc/mtab mount table it was sufficient
to call mount(2) and simply not update /etc/mtab to exclude autofs
mounts from mount listings.

Also, with this symlinking of /etc/mtab we have seen a shift in usage
toward using the proc mount tables directly.

But the autofs mount entries need to be retained when coming from the
proc file system for applications that need them (such as systemd) so
filtering out these entries within the kernel itself can't be done,
it needs be done in user space.

There are three reasons to omit the autofs mount entries.

One is that certain types of auto-mounts have an autofs mount for every
entry in their autofs mount map (autofs direct mounts) and these maps
can be quite large. This leads to mount table listings containing a lot
of unnecessary entries.

Also, this difference in behaviour between autofs implementations can
cause problems for applications that need to use the mount table and
expect autofs entries aren't present.

Lastly, there's very little that user space can do with autofs mount
entries since this must be left to the autofs mount owner, typically
the automount daemon. And it can also lead to attempts to access
automount managed paths resulting in mounts being triggered when they
aren't needed or mounts staying mounted for much longer thay they
need to be.

So the Linux autofs file system has been modified to accept a pseudo
mount option of "ignore" (as is used in other OS implementations) so
that user space utilities can use this as a hint to skip these autofs
entries on reading the mount table.

The Linux autofs automount daemon used getmntent(3) itself and has been
modified to use the proc file system directly so that it isn't affected
by the presence of the "ignore" mount option.

The use of the "ignore" mount option is opt-in by autofs users and a
configuration option has been added which defaults to not use the option
so if there are applications that need these entries, other than autofs
itself, they can be retained. Also, since this filtering is based on an
added mount option earlier versions of Linux autofs and other autofs file
system users will not use the option and so won't be affected by the change.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 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 +++++++++++++++++++++++++++++++++
 5 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/libmount/src/context.c b/libmount/src/context.c
index d325ce430..3c9448d91 100644
--- a/libmount/src/context.c
+++ b/libmount/src/context.c
@@ -171,6 +171,7 @@ int mnt_reset_context(struct libmnt_context *cxt)
 	cxt->mountdata = NULL;
 	cxt->subdir = NULL;
 	cxt->flags = MNT_FL_DEFAULT;
+	cxt->ignore_autofs = 0;
 
 	/* free additional mounts list */
 	while (!list_empty(&cxt->addmounts)) {
@@ -311,6 +312,8 @@ struct libmnt_context *mnt_copy_context(struct libmnt_context *o)
 	n->table_fltrcb = o->table_fltrcb;
 	n->table_fltrcb_data = o->table_fltrcb_data;
 
+	n->ignore_autofs = o->ignore_autofs;
+
 	return n;
 failed:
 	mnt_free_context(n);
@@ -1299,6 +1302,9 @@ int mnt_context_get_mountinfo(struct libmnt_context *cxt, struct libmnt_table **
 			goto end;
 		}
 
+		if (cxt->ignore_autofs)
+			mnt_table_enable_ignore_autofs(cxt->mountinfo);
+
 		if (cxt->table_errcb)
 			mnt_table_set_parser_errcb(cxt->mountinfo, cxt->table_errcb);
 		if (cxt->table_fltrcb)
@@ -2778,6 +2784,19 @@ int mnt_context_strerror(struct libmnt_context *cxt __attribute__((__unused__)),
 	return 0;
 }
 
+/**
+ * mnt_context_enable_ignore_autofs:
+ * @cxt: context
+ *
+ * Set to ignore all autofs mount table entries when reading
+ * the mount table.
+ */
+int mnt_context_enable_ignore_autofs(struct libmnt_context *cxt)
+{
+	if (!cxt)
+		return -EINVAL;
+	cxt->ignore_autofs = 1;
+}
 
 int mnt_context_get_generic_excode(int rc, char *buf, size_t bufsz, const char *fmt, ...)
 {
diff --git a/libmount/src/libmount.h.in b/libmount/src/libmount.h.in
index 2fb641d03..1a7b6ba3e 100644
--- a/libmount/src/libmount.h.in
+++ b/libmount/src/libmount.h.in
@@ -863,6 +863,8 @@ extern int mnt_context_strerror(struct libmnt_context *cxt, char *buf,
 				size_t bufsiz)
 				__ul_attribute__((deprecated));
 
+extern int mnt_context_enable_ignore_autofs(struct libmnt_context *cxt);
+
 extern int mnt_context_get_excode(struct libmnt_context *cxt,
                         int rc, char *buf, size_t bufsz);
 
diff --git a/libmount/src/libmount.sym b/libmount/src/libmount.sym
index b99fc4cc2..7eb77c1bb 100644
--- a/libmount/src/libmount.sym
+++ b/libmount/src/libmount.sym
@@ -371,4 +371,7 @@ MOUNT_2_39 {
 	mnt_context_enable_onlyonce;
 	mnt_context_is_lazy;
 	mnt_context_get_mountinfo_userdata;
+	mnt_context_enable_ignore_autofs;
+	mnt_table_enable_ignore_autofs;
+	mnt_table_ignore_autofs;
 } MOUNT_2_38;
diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h
index ffd9ba4fe..faf47fecb 100644
--- a/libmount/src/mountP.h
+++ b/libmount/src/mountP.h
@@ -148,6 +148,9 @@ extern int __mnt_table_is_fs_mounted(	struct libmnt_table *tb,
 					struct libmnt_fs *fstab_fs,
 					const char *tgt_prefix);
 
+extern int mnt_table_enable_ignore_autofs(struct libmnt_table *tb);
+extern int mnt_table_ignore_autofs(struct libmnt_table *tb);
+
 /*
  * Generic iterator
  */
@@ -251,6 +254,7 @@ struct libmnt_table {
 	int		(*fltrcb)(struct libmnt_fs *fs, void *data);
 	void		*fltrcb_data;
 
+	int		ignore_autofs;	/* ignore autofs mounts */
 
 	struct list_head	ents;	/* list of entries (libmnt_fs) */
 	void		*userdata;
@@ -357,7 +361,8 @@ struct libmnt_context
 	struct libmnt_ns	ns_tgt;		/* target namespace */
 	struct libmnt_ns	*ns_cur;	/* pointer to current namespace */
 
-	unsigned int	enabled_textdomain : 1;		/* bindtextdomain() called */
+	unsigned int	enabled_textdomain : 1;	/* bindtextdomain() called */
+	unsigned int 	ignore_autofs : 1;	/* ignore autofs mounts */
 };
 
 /* flags */
diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c
index 75f8e406b..293f0a8ed 100644
--- a/libmount/src/tab_parse.c
+++ b/libmount/src/tab_parse.c
@@ -762,6 +762,14 @@ int mnt_table_parse_stream(struct libmnt_table *tb, FILE *f, const char *filenam
 		if (rc == 0 && tb->fltrcb && tb->fltrcb(fs, tb->fltrcb_data))
 			rc = 1;	/* filtered out by callback... */
 
+		if (mnt_table_ignore_autofs(tb)) {
+			const char *fstype = mnt_fs_get_fstype(fs);
+
+			if (fstype && strcmp(fstype, "autofs") == 0 &&
+			    mnt_fs_get_option(fs, "ignore", NULL, NULL) == 0)
+				rc = 1; /* Skip "ignore" autofs entry */
+		}
+
 		/* add to the table */
 		if (rc == 0) {
 			rc = mnt_table_add_fs(tb, fs);
@@ -1059,6 +1067,31 @@ int mnt_table_set_parser_fltrcb(struct libmnt_table *tb,
 	return 0;
 }
 
+/*
+ * mnt_table_enable_ignore_autofs:
+ * @tb: table
+ *
+ * Enable ignore autofs mount table entries on reading.
+ */
+int mnt_table_enable_ignore_autofs(struct libmnt_table *tb)
+{
+	if (!tb)
+		return -EINVAL;
+	tb->ignore_autofs = 1;
+	return 0;
+}
+
+/*
+ * mnt_table_ignore_autofs:
+ * @tb: table
+ *
+ * Return the the enabled status of ignore autofs mount table entries.
+ */
+int mnt_table_ignore_autofs(struct libmnt_table *tb)
+{
+	return tb ? tb->ignore_autofs : 0;
+}
+
 /**
  * mnt_table_parse_swaps:
  * @tb: table



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

* [PATCH 2/2] mount: ignore autofs entries in mount listing
  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 1/2] libmount: use autofs mount hint to ignore autofs mount entries Ian Kent
@ 2022-11-16  2:00 ` Ian Kent
  2022-11-23  9:51 ` [PATCH 0/2] Add ability to use autofs mount option hint to exclude mount table list entries Karel Zak
  2 siblings, 0 replies; 10+ messages in thread
From: Ian Kent @ 2022-11-16  2:00 UTC (permalink / raw)
  To: util-linux; +Cc: Karel Zak, John Westerdale, fhirtz

Use the autofs mount option hint to ignore autofs mount table entries.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 sys-utils/mount.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys-utils/mount.c b/sys-utils/mount.c
index 283998f3b..29fda6b05 100644
--- a/sys-utils/mount.c
+++ b/sys-utils/mount.c
@@ -124,6 +124,8 @@ static void print_all(struct libmnt_context *cxt, char *pattern, int show_label)
 	struct libmnt_fs *fs;
 	struct libmnt_cache *cache = NULL;
 
+	mnt_context_enable_ignore_autofs(cxt);
+
 	if (mnt_context_get_mtab(cxt, &tb))
 		err(MNT_EX_SYSERR, _("failed to read mtab"));
 



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

* Re: [PATCH 0/2] Add ability to use autofs mount option hint to exclude mount table list entries
  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 1/2] libmount: use autofs mount hint to ignore autofs mount entries Ian Kent
  2022-11-16  2:00 ` [PATCH 2/2] mount: ignore autofs entries in mount listing Ian Kent
@ 2022-11-23  9:51 ` Karel Zak
  2022-11-23 10:55   ` Ian Kent
  2 siblings, 1 reply; 10+ messages in thread
From: Karel Zak @ 2022-11-23  9:51 UTC (permalink / raw)
  To: Ian Kent; +Cc: util-linux, John Westerdale, fhirtz


Hi Ian,

On Wed, Nov 16, 2022 at 10:00:39AM +0800, Ian Kent wrote:
> 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.

It's definitely no problem if the new behavior is optional and it's    
possible to enable/disable it. So, the systemd can keep it disabled
;-)

> 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.

What about findmnt(8), maybe we can add --autofs=yes/not. 

The problem is that we probably do not want to change the default
output as it's probably already used in many scripts, or is it
acceptable to hide autofs by default? It's already done for glibc, so
it may not be a big issue. Not sure.

    Karel

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


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

* Re: [PATCH 1/2] libmount: use autofs mount hint to ignore autofs mount entries
  2022-11-16  2:00 ` [PATCH 1/2] libmount: use autofs mount hint to ignore autofs mount entries Ian Kent
@ 2022-11-23  9:56   ` Karel Zak
  2022-11-23 11:00     ` Ian Kent
  0 siblings, 1 reply; 10+ messages in thread
From: Karel Zak @ 2022-11-23  9:56 UTC (permalink / raw)
  To: Ian Kent; +Cc: util-linux

On Wed, Nov 16, 2022 at 10:00:45AM +0800, Ian Kent wrote:
> diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c
> index 75f8e406b..293f0a8ed 100644
> --- a/libmount/src/tab_parse.c
> +++ b/libmount/src/tab_parse.c
> @@ -762,6 +762,14 @@ int mnt_table_parse_stream(struct libmnt_table *tb, FILE *f, const char *filenam
>  		if (rc == 0 && tb->fltrcb && tb->fltrcb(fs, tb->fltrcb_data))
>  			rc = 1;	/* filtered out by callback... */
>  
> +		if (mnt_table_ignore_autofs(tb)) {

 if (rc == 0 && mnt_table_ignore_autofs(tb)) {

Don't waste time if already ignored or in case of error :-)

> +/*
> + * mnt_table_enable_ignore_autofs:
> + * @tb: table
> + *
> + * Enable ignore autofs mount table entries on reading.
> + */
> +int mnt_table_enable_ignore_autofs(struct libmnt_table *tb)
> +{
> +	if (!tb)
> +		return -EINVAL;
> +	tb->ignore_autofs = 1;
> +	return 0;
> +}


The library usually uses the same function to enable as well as disable:

int mnt_table_enable_ignore_autofs(struct libmnt_table *tb, int ignore)
{
    if (tb)
        return -EINVAL;
    tb->ignore_autofs = ignore ? 1 : 0;
}

and mnt_context_enable_ignore_autofs() is the same.


    Karel

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


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

* Re: [PATCH 0/2] Add ability to use autofs mount option hint to exclude mount table list entries
  2022-11-23  9:51 ` [PATCH 0/2] Add ability to use autofs mount option hint to exclude mount table list entries Karel Zak
@ 2022-11-23 10:55   ` Ian Kent
  2022-11-23 11:17     ` Karel Zak
  0 siblings, 1 reply; 10+ messages in thread
From: Ian Kent @ 2022-11-23 10:55 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux, John Westerdale, fhirtz


On 23/11/22 17:51, Karel Zak wrote:
> Hi Ian,
>
> On Wed, Nov 16, 2022 at 10:00:39AM +0800, Ian Kent wrote:
>> 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.
> It's definitely no problem if the new behavior is optional and it's
> possible to enable/disable it. So, the systemd can keep it disabled
> ;-)

Indeed, agreed, ;)


>
>> 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.
> What about findmnt(8), maybe we can add --autofs=yes/not.


I think those that want this most will expect it to just work.


Typically they will be system admins that want to get rid of mount table

clutter resulting from autofs. So just changing an autofs configuration

option and having this work is the goal.


Historically autofs file system mounts didn't show up in mount table

listings and that's essentially the behavior I'm trying to bring back.


> The problem is that we probably do not want to change the default
> output as it's probably already used in many scripts, or is it
> acceptable to hide autofs by default? It's already done for glibc, so
> it may not be a big issue. Not sure.

Of course yes, and that's also the main reason we can't filter the

proc file system directly from the kernel, it must remain the

authoritative source with all mounts present so they can be seen if

needed.


In order for this to work the autofs user (typically a system admin)

needs to change an autofs configuration setting to make automount(8)

include the "ignore" option with autofs mounts so it's a conscious

choice. Otherwise there's no change.


Ian


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

* Re: [PATCH 1/2] libmount: use autofs mount hint to ignore autofs mount entries
  2022-11-23  9:56   ` Karel Zak
@ 2022-11-23 11:00     ` Ian Kent
  2022-11-23 11:08       ` Karel Zak
  0 siblings, 1 reply; 10+ messages in thread
From: Ian Kent @ 2022-11-23 11:00 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux


On 23/11/22 17:56, Karel Zak wrote:
> On Wed, Nov 16, 2022 at 10:00:45AM +0800, Ian Kent wrote:
>> diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c
>> index 75f8e406b..293f0a8ed 100644
>> --- a/libmount/src/tab_parse.c
>> +++ b/libmount/src/tab_parse.c
>> @@ -762,6 +762,14 @@ int mnt_table_parse_stream(struct libmnt_table *tb, FILE *f, const char *filenam
>>   		if (rc == 0 && tb->fltrcb && tb->fltrcb(fs, tb->fltrcb_data))
>>   			rc = 1;	/* filtered out by callback... */
>>   
>> +		if (mnt_table_ignore_autofs(tb)) {
>   if (rc == 0 && mnt_table_ignore_autofs(tb)) {
>
> Don't waste time if already ignored or in case of error :-)

Will do in v2, thanks.


>
>> +/*
>> + * mnt_table_enable_ignore_autofs:
>> + * @tb: table
>> + *
>> + * Enable ignore autofs mount table entries on reading.
>> + */
>> +int mnt_table_enable_ignore_autofs(struct libmnt_table *tb)
>> +{
>> +	if (!tb)
>> +		return -EINVAL;
>> +	tb->ignore_autofs = 1;
>> +	return 0;
>> +}
>
> The library usually uses the same function to enable as well as disable:
>
> int mnt_table_enable_ignore_autofs(struct libmnt_table *tb, int ignore)
> {
>      if (tb)
>          return -EINVAL;
>      tb->ignore_autofs = ignore ? 1 : 0;
> }
>
> and mnt_context_enable_ignore_autofs() is the same.

Right, I wasn't sure about this.

I had something similar initially.


I'll change it for v2, what about the check-if-enabled function,

any conventions for those?


Ian


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

* Re: [PATCH 1/2] libmount: use autofs mount hint to ignore autofs mount entries
  2022-11-23 11:00     ` Ian Kent
@ 2022-11-23 11:08       ` Karel Zak
  0 siblings, 0 replies; 10+ messages in thread
From: Karel Zak @ 2022-11-23 11:08 UTC (permalink / raw)
  To: Ian Kent; +Cc: util-linux

On Wed, Nov 23, 2022 at 07:00:08PM +0800, Ian Kent wrote:
> I'll change it for v2, what about the check-if-enabled function,
> 
> any conventions for those?

I usually use _is_ or _has_ in the function name, maybe

 mnt_table_is_noautofs()
 mnt_context_is_noautofs()

and maybe

 mnt_table_enable_noautofs() 

not sure how horrible is it for native English speakers ;-)

    Karel

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


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

* Re: [PATCH 0/2] Add ability to use autofs mount option hint to exclude mount table list entries
  2022-11-23 10:55   ` Ian Kent
@ 2022-11-23 11:17     ` Karel Zak
  0 siblings, 0 replies; 10+ messages in thread
From: Karel Zak @ 2022-11-23 11:17 UTC (permalink / raw)
  To: Ian Kent; +Cc: util-linux, John Westerdale, fhirtz

On Wed, Nov 23, 2022 at 06:55:27PM +0800, Ian Kent wrote:
> In order for this to work the autofs user (typically a system admin)
> needs to change an autofs configuration setting to make automount(8)
> include the "ignore" option with autofs mounts so it's a conscious
> choice. Otherwise there's no change.

I see (well, I reread the commit message PATCH 1/2;-)

It means we can change the default to ignore the entries, and add 
findmnt --autofs to make the entries accessible if necessary.

    Karel

> 
> 
> Ian
> 

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


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

* [PATCH 2/2] mount: ignore autofs entries in mount listing
  2023-03-13  1:42 [PATCH 1/2] libmount: dont ignore autofs mounts by default Ian Kent
@ 2023-03-13  1:43 ` Ian Kent
  0 siblings, 0 replies; 10+ messages in thread
From: Ian Kent @ 2023-03-13  1:43 UTC (permalink / raw)
  To: util-linux; +Cc: fhirtz, John Westerdale, Frank Sorenson

Since we can't enable use of ignoring autofs mounts that have the
"ignore" option present by default (systemd could get confused) it's
necessary to enable it for individual applications.

The mount utility is one applcation we need it for so enable it.

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>
---
 sys-utils/mount.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys-utils/mount.c b/sys-utils/mount.c
index 6590272c7..dba6fcae9 100644
--- a/sys-utils/mount.c
+++ b/sys-utils/mount.c
@@ -124,6 +124,8 @@ static void print_all(struct libmnt_context *cxt, char *pattern, int show_label)
 	struct libmnt_fs *fs;
 	struct libmnt_cache *cache = NULL;
 
+	mnt_context_enable_noautofs(cxt, 1);
+
 	if (mnt_context_get_mtab(cxt, &tb))
 		err(MNT_EX_SYSERR, _("failed to read mtab"));
 



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

end of thread, other threads:[~2023-03-13  1:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 1/2] libmount: use autofs mount hint to ignore autofs mount entries Ian Kent
2022-11-23  9:56   ` Karel Zak
2022-11-23 11:00     ` Ian Kent
2022-11-23 11:08       ` Karel Zak
2022-11-16  2:00 ` [PATCH 2/2] mount: ignore autofs entries in mount listing Ian Kent
2022-11-23  9:51 ` [PATCH 0/2] Add ability to use autofs mount option hint to exclude mount table list entries Karel Zak
2022-11-23 10:55   ` Ian Kent
2022-11-23 11:17     ` Karel Zak
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

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