From: "Theodore Tso" <tytso@mit.edu>
To: Anand Jain <asj@kernel.org>
Cc: linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 0/3] fix s_uuid and f_fsid consistency for cloned filesystems
Date: Sun, 22 Mar 2026 15:31:51 -0500 [thread overview]
Message-ID: <20260322203151.GA98947@mac.lan> (raw)
In-Reply-To: <cover.1772095546.git.asj@kernel.org>
On Thu, Feb 26, 2026 at 10:23:32PM +0800, Anand Jain wrote:
>
> | s_uuid f_fsid
> --------------|---------------------------
> EXT4 | same same
> Btrfs | random random
> XFS | same f(devt)
> EXT4-patched | same f(devt)
> Btrfs-patched | same f(s_uuid,rootid,devt)
I don't *object* to changing ext4 reports since having something that
is unique is probably better. However, my bigger concern is using
f_fsid in the first place. It's only 64 bits, and that's really not
enough to gaurantee uniqueness. And even as you've proposed to change
things, it's not consistent across file systems. In particular, your
proposed solution mixes s_uuid into btrfs-patched, but not
ext4-patched. Why?
> Problem
> -------
> Btrfs currently never duplicates s_uuid or f_fsid for cloned filesystems.
> When an fsid collision is detected at mount time, btrfs generates a new
> in-memory fsid (temp_fsid), but this is ephemeral — it changes on every
> mount. This has two consequences:
>
> 1. IMA (Integrity Measurement Architecture) cannot reliably track the
> filesystem across mount-cycle, since the f_fsid it sees keeps changing.
> This does not scale. Whereas on the otherhand if you have same s_uuid
> on multiple filesystems, monitoring per distint filesystem is lost.
The problem with using f(dev_t) for IMA is that if you have a
removable device (e.g., an SD card), reporting f_fsid as purely being
a function of dev_t means that the if an SD card ejected, and replaced
with another, the fsid_t will manifestly *not* be unique. So in that
sense, replace f(dev_t) with f(s_uuid) would be worse if you think
"file system unique id" should be unique in the case of removable
storage devices.
If the audit log includes mounts and unmounts, then this might not be
fatal. But if less-than intelligent system administrator or LLM tries
to analyize an audit log using tools like "grep", it would be pretty
easy for someone to get misled.
I know you were primarily interested in cloned file systems, but I
think we also need to take into account other cases, including ones
where there might be more the file system associated with a block
device over time.
> 2. If we instead allow cloned filesystems to share the same f_fsid (as
> ext4 currently does), fanotify loses the ability to distinguish
> between distinct filesystem instances. FAN_EVENT_INFO_TYPE_FID events
> will fail to resolve to the correct mountpoint when f_fsid values
> are identical across clones.
My personal opinion is that f_fsuid is just a terrible interface, the
fact that IMA and fanotify used this is regrettable. I understand why
it happened, because there wasn't anything better, and for many use
cases, it's good enough. But not all.
So I hope we can just actively discourage anyone else using it. Given
that exactly it has not been standardized, across different operating
systems, and different file systems for Linux --- hopefully most
people will have already made that choice.
- Ted
prev parent reply other threads:[~2026-03-22 20:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 14:23 [PATCH 0/3] fix s_uuid and f_fsid consistency for cloned filesystems Anand Jain
2026-02-26 14:27 ` [PATCH 1/3] btrfs: derive f_fsid from on-disk fsuuid and dev_t Anand Jain
2026-02-26 14:27 ` [PATCH 2/3] btrfs: use on-disk uuid for s_uuid in temp_fsid mounts Anand Jain
2026-03-04 13:28 ` [PATCH 0/3] fix s_uuid and f_fsid consistency for cloned filesystems Christoph Hellwig
2026-03-05 9:32 ` Anand Jain
2026-03-05 14:21 ` Christoph Hellwig
2026-03-22 20:31 ` Theodore Tso [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=20260322203151.GA98947@mac.lan \
--to=tytso@mit.edu \
--cc=asj@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
/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