From: David Sterba <dsterba@suse.cz>
To: Anand Suveer Jain <asj@kernel.org>
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: Mon, 14 Sep 2026 15:14:55 +0200 [thread overview]
Message-ID: <20260914131455.GH54722@suse.cz> (raw)
In-Reply-To: <d0bd13fa-9126-4efd-9166-ed6c1c08c24d@kernel.org>
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.
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?
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.
next prev parent reply other threads:[~2026-09-14 13:15 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 [this message]
2026-09-15 16:11 ` Anand Suveer Jain
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=20260914131455.GH54722@suse.cz \
--to=dsterba@suse.cz \
--cc=asj@kernel.org \
--cc=dave.hansen@intel.com \
--cc=dsterba@suse.com \
--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.