From patchwork Tue Oct 31 05:39:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Misono Tomohiro X-Patchwork-Id: 10033621 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6EA3C602B9 for ; Tue, 31 Oct 2017 05:39:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 562AB286A9 for ; Tue, 31 Oct 2017 05:39:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48E3B28848; Tue, 31 Oct 2017 05:39:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0729A286A9 for ; Tue, 31 Oct 2017 05:39:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753124AbdJaFjJ (ORCPT ); Tue, 31 Oct 2017 01:39:09 -0400 Received: from mgwkm01.jp.fujitsu.com ([202.219.69.168]:21414 "EHLO mgwkm01.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752879AbdJaFjI (ORCPT ); Tue, 31 Oct 2017 01:39:08 -0400 Received: from kw-mxq.gw.nic.fujitsu.com (unknown [192.168.231.130]) by mgwkm01.jp.fujitsu.com with smtp id 406f_9d3f_dfc12581_1015_495f_9696_2af08720fd74; Tue, 31 Oct 2017 14:39:05 +0900 Received: from g01jpfmpwyt03.exch.g01.fujitsu.local (g01jpfmpwyt03.exch.g01.fujitsu.local [10.128.193.57]) by kw-mxq.gw.nic.fujitsu.com (Postfix) with ESMTP id AACE4AC00C9 for ; Tue, 31 Oct 2017 14:39:05 +0900 (JST) Received: from G01JPEXCHYT15.g01.fujitsu.local (G01JPEXCHYT15.g01.fujitsu.local [10.128.194.54]) by g01jpfmpwyt03.exch.g01.fujitsu.local (Postfix) with ESMTP id 0367546E73A for ; Tue, 31 Oct 2017 14:39:05 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.5.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20170217-enc X-SHieldMailCheckerMailID: d31b665fa07c47bc8e07385d7a0d12dd To: linux-btrfs From: "Misono, Tomohiro" Subject: [PATCH] btrfs-progs: ins: print uuid only if it exists Message-ID: <7979b9a1-37d6-9eec-79a7-1730b8338b7f@jp.fujitsu.com> Date: Tue, 31 Oct 2017 14:39:01 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Language: en-US X-SecurityPolicyCheck-GC: OK by FENCE-Mail X-TM-AS-MML: disable Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP UUID of ROOT_ITEM is empty if it is not subvolume (and not created by kernel). So, just skip it if it is empty just like parent/received UUID. Signed-off-by: Tomohiro Misono Reviewed-by: Qu Wenruo --- print-tree.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/print-tree.c b/print-tree.c index 8abd760..9d1b862 100644 --- a/print-tree.c +++ b/print-tree.c @@ -581,8 +581,10 @@ static void print_root_item(struct extent_buffer *leaf, int slot) flags_str); if (root_item.generation == root_item.generation_v2) { - uuid_unparse(root_item.uuid, uuid_str); - printf("\t\tuuid %s\n", uuid_str); + if (!empty_uuid(root_item.uuid)) { + uuid_unparse(root_item.uuid, uuid_str); + printf("\t\tuuid %s\n", uuid_str); + } if (!empty_uuid(root_item.parent_uuid)) { uuid_unparse(root_item.parent_uuid, uuid_str); printf("\t\tparent_uuid %s\n", uuid_str);