From: Anand Suveer Jain <asj@kernel.org>
To: dsterba@suse.cz
Cc: Dave Hansen <dave.hansen@intel.com>,
sashal@kernel.org, linux-btrfs@vger.kernel.org,
David Woodhouse <dwmw2@infradead.org>,
David Sterba <dsterba@suse.com>,
"Macieira, Thiago" <thiago.macieira@intel.com>
Subject: Re: [PATCH 1/3] btrfs: derive f_fsid from on-disk fsuuid and dev_t
Date: Wed, 16 Sep 2026 00:11:01 +0800 [thread overview]
Message-ID: <847b96c6-9e39-4eef-889c-3985f7eb4e3a@kernel.org> (raw)
In-Reply-To: <20260914131455.GH54722@suse.cz>
On 14/9/26 21:14, David Sterba wrote:
> On Sat, Sep 12, 2026 at 06:19:21PM +0800, Anand Suveer Jain wrote:
>> --- a/fs/btrfs/super.c
>> +++ b/fs/btrfs/super.c
>> @@ -1836,8 +1836,12 @@ static int btrfs_statfs(struct dentry *dentry,
>> struct kstatfs *buf)
>> f_fsid.val[0] ^= btrfs_root_id(BTRFS_I(d_inode(dentry))->root)
>>>> 32;
>> f_fsid.val[1] ^= btrfs_root_id(BTRFS_I(d_inode(dentry))->root);
>>
>> - /* Hash dev_t to avoid f_fsid collision with cloned filesystems. */
>> - if (fs_info->fs_devices->total_devices == 1) {
>> + /*
>> + * Hash dev_t to avoid f_fsid collisions with cloned filesystems.
>> + * Only do this when a clone is present so the original filesystem
>> + * (mounted first) maintains backward-compatible f_fsid behavior.
>> + */
>> + if (fs_info->fs_devices->temp_fsid) {
>> __kernel_fsid_t dev_fsid =
>
> This should fix the most common case where people don't have any cloned
> filesystems at all, so I guess this is good as a fix. Please send it so
> I can add it to this -rc pull request. We can try to catch next week's
> release of stable trees.
The fix is already on the ML.
https://lore.kernel.org/linux-btrfs/16069a6fc651168bfcd2394d6e57ce63a50231ed.1789235482.git.asj@kernel.org/
> Related to the cloned filesystems, it can get complicated if the
> original filesystem gets unmounted and mounted again, now it would have
> the temp_fsid set, right?
No, it won't. Once unmounted, there is no longer an active fs_devices
using that original UUID in the system, so the next mount will claim the
original UUID without needing temp_fsid.
> I don't see the temp_fsid documented (btrfs-progs) other than in the
> changelogs and briefly in the sysfs file. This should be more visible as
> a separate feature and with the known use cases.
Agreed. Do you think btrfs(5) is a good place to document temp_fsid?
next prev parent reply other threads:[~2026-09-15 16:11 UTC|newest]
Thread overview: 19+ 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-09-11 12:32 ` Dave Hansen
2026-09-11 14:51 ` Anand Suveer Jain
2026-09-11 16:07 ` Thiago Macieira
2026-09-11 18:12 ` David Woodhouse
2026-09-12 10:10 ` Anand Suveer Jain
2026-09-11 17:23 ` David Sterba
2026-09-12 10:19 ` Anand Suveer Jain
2026-09-14 13:14 ` David Sterba
2026-09-15 16:11 ` Anand Suveer Jain [this message]
2026-09-17 17:26 ` David Sterba
2026-09-20 14:13 ` Anand Suveer Jain
2026-02-26 14:27 ` [PATCH 2/3] btrfs: use on-disk uuid for s_uuid in temp_fsid mounts Anand Jain
2026-02-26 14:28 ` [RFC PATCH 3/3] ext4: derive f_fsid from block device to avoid collisions 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
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=847b96c6-9e39-4eef-889c-3985f7eb4e3a@kernel.org \
--to=asj@kernel.org \
--cc=dave.hansen@intel.com \
--cc=dsterba@suse.com \
--cc=dsterba@suse.cz \
--cc=dwmw2@infradead.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=thiago.macieira@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.