Re: Unable to set log priority for all direct mounts

Ian Kent <[email protected]> Fri, 22 May 2026 14:02:29 +0800
Newsgroups org.kernel.vger.autofs
Message-ID <[email protected]>
On Thu, 2026-05-21 at 17:41 -0700, Deke Clinger wrote:
> Hi Ian,
>=20
> Thanks for fixing this, it was my request originally. It is super
> useful to be able to change the log level for the whole direct map
> with one command when that map is tens of thousands of entries long.

No problem Deke, it was a regression after all.

Goldwyn, I'll push this to the autofs repo. then.


Ian
>=20
> Regards,
>=20
> -Deke
>=20
> On Mon, 18 May 2026, Ian Kent wrote:
>=20
> > WARNING: This email originated from outside of Qualcomm. Please be
> > wary of any
> > links or attachments, and do not enable macros.
> >=20
> > On 15/5/26 04:01, Goldwyn Rodrigues wrote:
> > > Hello,
> > >=20
> > > Since the work to have a single FIFO file for setting log
> > > priority
> > > (16ea4156 ("autofs-5.1.8 - switch to application wide command
> > > pipe"), to
> > > be more precise 16ea4156 (autofs-5.1.8 - switch to application
> > > wide
> > > command pipe), automount has lost the ability to set the log
> > > priority of
> > > all direct mounts using the path "/-".
> > >=20
> > >=20
> > > # sudo automount -l info /-
> > > Could not find device id for mount /-
> > >=20
> > > This is because automount attempts to mount and get verifies the
> > > real
> > > path which is non-existent in case of direct mounts "/-".
> > >=20
> > > In the automount program, the log priority is set pretty early
> > > and much
> > > before the master map is setup. So we cannot check on the autofs
> > > dev
> > > either.
> > >=20
> > > What would be the best way to solve this? Should we just document
> > > it
> > > as a feature loss?
> > >=20
> >=20
> > Haven't actually tested this but it should work to fix the log
> > priority
> >=20
> > for /-.
> >=20
> > Could you give it a try please.
> >=20
> >=20
> > autofs-5.1.9 - fix handling of direct mount path in command handler
> >=20
> > From: Ian Kent <[email protected]>
> >=20
> > Commit 16ea4156471e ("autofs-5.1.8 - switch to application wide
> > command
> > pipe") broke the ability to set the log priority from the command
> > line
> > for all direct mounts.
> >=20
> > As Goldwyn Rodrigues points out the autofs_point structure for
> > direct
> > mounts doesn't have a real mount associated with it so it needs
> > special
> > handling which was ommitted in commit 16ea4156471e.
> >=20
> > Fixes: 16ea4156471e ("autofs-5.1.8 - switch to application wide
> > command pipe")
> > Reported-By: Goldwyn Rodrigues <[email protected]>
> > Signed-off-by: Ian Kent <[email protected]>
> > ---
> > =C2=A0CHANGELOG=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=
=C2=A0=C2=A0=C2=A0 1 +
> > =C2=A0daemon/automount.c |=C2=A0=C2=A0 17 +++++++++++++++--
> > =C2=A0daemon/master.c=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 11 +++++++++++
> > =C2=A0include/master.h=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0 3 ++-
> > =C2=A04 files changed, 29 insertions(+), 3 deletions(-)
> >=20
> > diff --git a/CHANGELOG b/CHANGELOG
> > index d6d594e9e..0fc529f32 100644
> > --- a/CHANGELOG
> > +++ b/CHANGELOG
> > @@ -89,6 +89,7 @@
> > =C2=A0- do_reconnect() expiry check of dclist BEFORE lookup using it.
> > =C2=A0- fix mailing list subscription address.
> > =C2=A0- fix table_lookup_ino() fd reference.
> > +- fix handling of direct mount path in command handler.
> >=20
> > =C2=A002/11/2023 autofs-5.1.9
> > =C2=A0- fix kernel mount status notification.
> > diff --git a/daemon/automount.c b/daemon/automount.c
> > index 517764119..a01d176ae 100644
> > --- a/daemon/automount.c
> > +++ b/daemon/automount.c
> > @@ -1487,7 +1487,13 @@ static void handle_cmd_pipe_fifo_message(int
> > fd)
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 return;
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> >=20
> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ap =3D master_find_mapent_by_devi=
d(devid);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* There's no "real" devid for th=
e top level direct mount
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * container so we use -1.
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (devid =3D=3D -1)
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 ap =3D master_find_mapent_by_path("/-");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 ap =3D master_find_mapent_by_devid(devid);
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (!ap) {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 error(LOGOPT_ANY, "can't locate autofs_point for
> > device id
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 %ld.", devid);
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 return;
> > @@ -1548,7 +1554,14 @@ static int set_log_priority(const char
> > *path, int
> > priority)
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (!ops) {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 fprintf(stderr, "Could not get ioctl ops\n");
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 return -1;
> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* There's no "real" devid for th=
e top level direct mount
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * container so we use -1.
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (!strcmp(path, "/-"))
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 devid =3D -1;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 ret =3D ops->mount_device(LOGOPT_ANY, path, 0,
> > &devid);
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 if (ret =3D=3D -1 || ret =3D=3D 0) {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fprintf(std=
err,
> > diff --git a/daemon/master.c b/daemon/master.c
> > index d85dd8975..8b7450e73 100644
> > --- a/daemon/master.c
> > +++ b/daemon/master.c
> > @@ -711,6 +711,17 @@ struct master_mapent *master_find_mapent(const
> > char
> > *path)
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return NULL;
> > =C2=A0}
> >=20
> > +struct autofs_point *master_find_mapent_by_path(const char *path)
> > +{
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct autofs_point *ap =3D NULL;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct master_mapent *entry;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 entry =3D master_find_mapent(path=
);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (entry)
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 ap =3D entry->ap;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ap;
> > +}
> > +
> > =C2=A0struct autofs_point *master_find_mapent_by_devid(dev_t devid)
> > =C2=A0{
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct master *master =3D master_l=
ist;
> > diff --git a/include/master.h b/include/master.h
> > index 71610611f..3ca7ad8d6 100644
> > --- a/include/master.h
> > +++ b/include/master.h
> > @@ -105,7 +105,8 @@ void master_source_readlock(struct
> > master_mapent *);
> > =C2=A0void master_source_unlock(struct master_mapent *);
> > =C2=A0void master_source_lock_cleanup(void *);
> > =C2=A0struct master_mapent *master_find_mapent(const char *);
> > -struct autofs_point *master_find_mapent_by_devid(dev_t devid);
> > +struct autofs_point *master_find_mapent_by_path(const char *);
> > +struct autofs_point *master_find_mapent_by_devid(dev_t);
> > =C2=A0struct master_mapent *master_new_mapent(const char *, time_t);
> > =C2=A0void master_add_mapent(struct master_mapent *);
> > =C2=A0void master_remove_mapent(struct master_mapent *);
> >=20
> >=20
> >=20
> >=20