diff mbox

btrfs-progs 4.1-rc1: btrfstune -u reporting incorrect current fsid?

Message ID 55837315.90109@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Qu Wenruo June 19, 2015, 1:40 a.m. UTC
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:
---

---

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
>
--
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

Comments

David Sterba June 19, 2015, 10:26 a.m. UTC | #1
On Fri, Jun 19, 2015 at 09:40:37AM +0800, Qu Wenruo wrote:
> Just a little tip to take less time on the bug:
> -       uuid_parse((const char*)fs_info->fsid, old_fsid);
> +       memcpy(old_fsid, fs_info->fsid, BTRFS_UUID_SIZE);

Thanks, that's what I did.
--
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
diff mbox

Patch

--- 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);