From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <dsterba@suse.cz>, Mike Fleetwood <mike.fleetwood@googlemail.com>,
linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: btrfs-progs 4.1-rc1: btrfstune -u reporting incorrect current fsid?
Date: Fri, 19 Jun 2015 09:40:37 +0800 [thread overview]
Message-ID: <55837315.90109@cn.fujitsu.com> (raw)
In-Reply-To: <20150618173332.GJ6761@twin.jikos.cz>
David Sterba wrote on 2015/06/18 19:33 +0200:
> On Wed, Jun 17, 2015 at 10:21:45PM +0100, Mike Fleetwood wrote:
>> It also upper cases the UUID where as btrfs fi sh and blkid don't.
>
> Ok, I'll switch that to lowercase so it's consistent with the rest.
>
>> I've done a quick test on changing the UUID of a btrfs. It worked, but
>> btrfstune -u didn't print the same current uuid that btrfs fi sh does.
>
> Seems that the reporting is broken in the btrfstune side. I've
> reproduced it here. I've used btrfs-show-super in the tests and did not
> notice that the 'current fsid' is wrong. Thanks.
Just a little tip to take less time on the bug:
---
--- a/btrfstune.c
+++ b/btrfstune.c
@@ -349,7 +349,7 @@ static int change_uuid(struct btrfs_fs_info
*fs_info, const char *new_fsid_str)
fs_info->new_fsid = new_fsid;
fs_info->new_chunk_tree_uuid = new_chunk_id;
- uuid_parse((const char*)fs_info->fsid, old_fsid);
+ memcpy(old_fsid, fs_info->fsid, BTRFS_UUID_SIZE);
uuid_unparse_upper(old_fsid, uuid_buf);
printf("Current fsid: %s\n", uuid_buf);
---
Also, you can remove the old_fsid variant if you want and just use
fs_info->fsid.
Thanks,
Qu
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2015-06-19 1:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-17 21:21 btrfs-progs 4.1-rc1: btrfstune -u reporting incorrect current fsid? Mike Fleetwood
2015-06-18 17:33 ` David Sterba
2015-06-19 1:40 ` Qu Wenruo [this message]
2015-06-19 10:26 ` David Sterba
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=55837315.90109@cn.fujitsu.com \
--to=quwenruo@cn.fujitsu.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=mike.fleetwood@googlemail.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