Package: mount
Version: 2.41.1-2
Severity: normal
Tags: upstream

Hi,

I ran into this when configuring autofs direct mounts, which creates a trigger
mount and the actual mount at the same mount point (whenever the auto-mounting
triggers), so mounts may look like these, for example:

$ mount | grep /mnt/tmp
/etc/auto.direct on /mnt/tmp type autofs 
(rw,relatime,fd=9,pgrp=1582,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=21088)
tmpfs on /mnt/tmp type tmpfs (rw,relatime,inode64)

First entry is the autofs trigger mount, with type autofs. The second one is the
actual mount, triggered by changing the directory to /mnt/tmp.

One may want to try and unmount the actual (tmpfs) mount using a command like
this one, leaving the autofs trigger mount in place:

sudo umount -t tmpfs /mnt/tmp

However, if tmpfs is not currently mounted, then this command will also remove
the autofs trigger mount, despite its type being autofs. This is unexpected
behavior, which can also be disruptive, since removing the trigger mount will
prevent future auto-mounting of /mnt/tmp from functioning properly, until the
next reload of the autofs service.

The potential fix appears to be a simple one, setting up of the types filter
just needs to be moved out of the clause which is only triggered for --all:
https://github.com/util-linux/util-linux/blob/master/sys-utils/umount.c#L624

This bug affects the trixie version of umount as well.

-- System Information:
Debian Release: forky/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.16.3+deb14-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages mount depends on:
ii  libblkid1      2.41.1-2
ii  libc6          2.41-12
ii  libmount1      2.41.1-2
ii  libselinux1    3.8.1-1
ii  libsmartcols1  2.41.1-2

mount recommends no packages.

Versions of packages mount suggests:
ii  nfs-common  1:2.8.3-1+b1

-- no debconf information

Reply via email to