btrfs-progs: btrfstune: print correct current uuid during rewrite
authorDavid Sterba <dsterba@suse.cz>
Thu, 18 Jun 2015 17:47:28 +0000 (19:47 +0200)
committerDavid Sterba <dsterba@suse.cz>
Thu, 18 Jun 2015 17:49:44 +0000 (19:49 +0200)
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 <mike.fleetwood@googlemail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
btrfstune.c

index 4e42c5c..6f07f31 100644 (file)
@@ -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);