lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260209183822.GA15302@macsyma.lan>
Date: Mon, 9 Feb 2026 13:38:22 -0500
From: "Theodore Tso" <tytso@....edu>
To: 294772273 <zy931031@....qq.com>
Cc: linux-ext4 <linux-ext4@...r.kernel.org>,
        "adilger.kernel" <adilger.kernel@...ger.ca>
Subject: Re: [QUESTION] ext4: Why does fsconfig allow repeated mounting?

On Tue, Feb 10, 2026 at 12:07:27AM +0800, 294772273 wrote:

> The mount interface will report an error for repeated mounting, but
> fsconfig seems to allow this. Why is that?

The mount interface does allow repeated mounting:

root@...-xfstests:~# mount /dev/vdc /vdc
[248226.221469] EXT4-fs (vdc): mounted filesystem 06dd464f-1c3a-4a2b-b3dd-e937c1e7
624f r/w with ordered data mode. Quota mode: none.
root@...-xfstests:~# mount /dev/vdc /vdc
root@...-xfstests:~# grep vdc  /proc/mounts  
/dev/vdc /vdc ext4 rw,relatime 0 0
/dev/vdc /vdc ext4 rw,relatime 0 0

This is related to mounting the same block device in multiple places:

root@...-xfstests:~# mount /dev/vdc /mnt/b
root@...-xfstests:~# grep vdc /proc/mounts
/dev/vdc /mnt/a ext4 rw,relatime 0 0
/dev/vdc /mnt/b ext4 rw,relatime 0 0
root@...-xfstests:~#

... which in turn is related to using bind mounts:

root@...-xfstests:~# mount /dev/vdc /mnt/a
[248574.078106] EXT4-fs (vdc): mounted filesystem 06dd464f-1c3a-4a2b-b3dd-e937c1
e7624f r/w with ordered data mode. Quota mode: none.
root@...-xfstests:~# mount --bind /mnt/a /mnt/b
root@...-xfstests:~# grep vdc /proc/mounts
/dev/vdc /mnt/a ext4 rw,relatime 0 0
/dev/vdc /mnt/b ext4 rw,relatime 0 0
root@...-xfstests:~#

In both of these cases, you have to unmount the file system all of the
mount points (and if applicable, in all namespaces) before the struct
super for the block device is really unmounted.

root@...-xfstests:~# umount /mnt/a
root@...-xfstests:~# umount /mnt/b
[248743.872394] EXT4-fs (vdc): unmounting filesystem 06dd464f-1c3a-4a2b-b3dd-e937c1e7624f.
root@...-xfstests:~# 

						- Ted

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ