From bdc6c859c40eb77c3cfc97b4a7f7eee84689064b Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 18 Jun 2015 19:47:28 +0200 Subject: [PATCH] btrfs-progs: btrfstune: print correct current uuid during rewrite uuid_unparse is supposed to take the ASCII representation of a UUID, so we have to pass the raw fsid buffer. Reported-by: Mike Fleetwood Signed-off-by: David Sterba --- btrfstune.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrfstune.c b/btrfstune.c index 4e42c5ce..6f07f314 100644 --- 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, (const char*)fs_info->fsid, BTRFS_UUID_SIZE); uuid_unparse(old_fsid, uuid_buf); printf("Current fsid: %s\n", uuid_buf);