All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Mikhalitsyn <alex@amutable.com>
To: dsterba@suse.com
Cc: mason@kernel.org, Alexander Mikhalitsyn <alex@amutable.com>,
	Lennart Poettering <lennart@amutable.com>,
	linux-btrfs@vger.kernel.org
Subject: [PATCH] btrfs: use super_set_uuid to support FS_IOC_GETFSUUID
Date: Tue, 24 Nov 2026 16:46:04 +0100	[thread overview]
Message-ID: <20261124154604.77736-1-alex@amutable.com> (raw)

Currently, FS_IOC_GETFSUUID fails with ENOTTY. To fix that we should
use super_set_uuid() as other filesystems do.

Reported-by: Lennart Poettering <lennart@amutable.com>
Signed-off-by: Alexander Mikhalitsyn <alex@amutable.com>
---
 fs/btrfs/disk-io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index d8d433ac458b..fde9f4c4ea11 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3616,9 +3616,9 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
 	 * on-disk UUID directly from the super_copy.
 	 */
 	if (fs_info->fs_devices->temp_fsid)
-		memcpy(&sb->s_uuid, fs_info->super_copy->fsid, BTRFS_FSID_SIZE);
+		super_set_uuid(sb, fs_info->super_copy->fsid, BTRFS_FSID_SIZE);
 	else
-		memcpy(&sb->s_uuid, fs_info->fs_devices->fsid, BTRFS_FSID_SIZE);
+		super_set_uuid(sb, fs_info->fs_devices->fsid, BTRFS_FSID_SIZE);
 
 	mutex_lock(&fs_info->chunk_mutex);
 	ret = btrfs_read_sys_array(fs_info);
-- 
2.47.3


             reply	other threads:[~2026-11-24 15:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 15:46 Alexander Mikhalitsyn [this message]
2026-11-24 20:58 ` [PATCH] btrfs: use super_set_uuid to support FS_IOC_GETFSUUID Qu Wenruo
2026-11-25  8:41   ` Alexander Mikhalitsyn

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=20261124154604.77736-1-alex@amutable.com \
    --to=alex@amutable.com \
    --cc=dsterba@suse.com \
    --cc=lennart@amutable.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mason@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 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.