From patchwork Fri Jun 19 01:40:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 6642041 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DFB6C9F399 for ; Fri, 19 Jun 2015 01:42:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 07B9D20925 for ; Fri, 19 Jun 2015 01:42:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2EB7820921 for ; Fri, 19 Jun 2015 01:42:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752459AbbFSBkq (ORCPT ); Thu, 18 Jun 2015 21:40:46 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:15921 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752266AbbFSBko (ORCPT ); Thu, 18 Jun 2015 21:40:44 -0400 X-IronPort-AV: E=Sophos;i="5.13,625,1427731200"; d="scan'208";a="97301299" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 19 Jun 2015 09:44:49 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t5J1d3tS020778; Fri, 19 Jun 2015 09:39:03 +0800 Received: from [172.16.0.100] (10.167.226.33) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Fri, 19 Jun 2015 09:40:39 +0800 Subject: Re: btrfs-progs 4.1-rc1: btrfstune -u reporting incorrect current fsid? To: , Mike Fleetwood , linux-btrfs References: <20150618173332.GJ6761@twin.jikos.cz> From: Qu Wenruo Message-ID: <55837315.90109@cn.fujitsu.com> Date: Fri, 19 Jun 2015 09:40:37 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <20150618173332.GJ6761@twin.jikos.cz> X-Originating-IP: [10.167.226.33] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);