From: "Darrick J. Wong" <djwong@kernel.org>
To: Theodore Tso <tytso@mit.edu>
Cc: 294772273 <zy931031@vip.qq.com>,
linux-ext4 <linux-ext4@vger.kernel.org>,
"adilger.kernel" <adilger.kernel@dilger.ca>
Subject: Re: [QUESTION] ext4: Why does fsconfig allow repeated mounting?
Date: Mon, 9 Feb 2026 17:58:16 -0800 [thread overview]
Message-ID: <20260210015816.GQ7686@frogsfrogsfrogs> (raw)
In-Reply-To: <20260209183822.GA15302@macsyma.lan>
On Mon, Feb 09, 2026 at 01:38:22PM -0500, Theodore Tso wrote:
> 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@kvm-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@kvm-xfstests:~# mount /dev/vdc /vdc
> root@kvm-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@kvm-xfstests:~# mount /dev/vdc /mnt/b
> root@kvm-xfstests:~# grep vdc /proc/mounts
> /dev/vdc /mnt/a ext4 rw,relatime 0 0
> /dev/vdc /mnt/b ext4 rw,relatime 0 0
> root@kvm-xfstests:~#
>
> ... which in turn is related to using bind mounts:
>
> root@kvm-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@kvm-xfstests:~# mount --bind /mnt/a /mnt/b
> root@kvm-xfstests:~# grep vdc /proc/mounts
> /dev/vdc /mnt/a ext4 rw,relatime 0 0
> /dev/vdc /mnt/b ext4 rw,relatime 0 0
> root@kvm-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@kvm-xfstests:~# umount /mnt/a
> root@kvm-xfstests:~# umount /mnt/b
> [248743.872394] EXT4-fs (vdc): unmounting filesystem 06dd464f-1c3a-4a2b-b3dd-e937c1e7624f.
> root@kvm-xfstests:~#
This is a fun new feature of the post-fsconfig mount(8) binary, as I
discovered when some of my newer fstests exploded after the D12->13
transition.
--D
> - Ted
>
prev parent reply other threads:[~2026-02-10 1:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <tencent_2462A2D2BBD1792040E4BF74D8EE146E9D08@qq.com>
2026-02-09 18:38 ` [QUESTION] ext4: Why does fsconfig allow repeated mounting? Theodore Tso
2026-02-10 1:58 ` Darrick J. Wong [this message]
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=20260210015816.GQ7686@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=zy931031@vip.qq.com \
/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