From patchwork Tue Jun 18 03:52:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 2738361 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1E1D3C0AB1 for ; Tue, 18 Jun 2013 03:52:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2EFF4202E9 for ; Tue, 18 Jun 2013 03:52:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52AF6202DD for ; Tue, 18 Jun 2013 03:52:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753803Ab3FRDwN (ORCPT ); Mon, 17 Jun 2013 23:52:13 -0400 Received: from mail-pb0-f52.google.com ([209.85.160.52]:37465 "EHLO mail-pb0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752675Ab3FRDwN (ORCPT ); Mon, 17 Jun 2013 23:52:13 -0400 Received: by mail-pb0-f52.google.com with SMTP id xa12so3457620pbc.11 for ; Mon, 17 Jun 2013 20:52:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=91FAM5mjpuN67ZsgW5wjgcD2ltN9Eht2ra6M9aKYK9Q=; b=0uyXNNt9OUZmZ00f/Jw6hjn69Xs8KECuzgjS9D0PJjloeQAAUZKN1sCqpgzBNY6ZDs kF3kSgu0Qdn6c3qd2JS8fQUfHmom2jSCUNcijwXO8ctMgNOHfJLGNQfhY6tnYleYevBu VV9zzAf/WtckYcpmGs6yRCzlqTVTGq1W5er3JDFy106ztbcyXvSruELeKHKHaLMxMEYG KzsXiedlhbYho/RWYl1lRgP8NJxCfT5A3vQKZuGUO2ATh6xuELOpR9WHBFdU9OpVx882 NF4ntnP62Lgw0yQ6/RyD9z2ADBCP4+Nl8bxPK7OLMYk2Qrqjmj9MUBQ1s07+29UX1vnG WBgg== X-Received: by 10.66.0.7 with SMTP id 7mr340918paa.199.1371527532737; Mon, 17 Jun 2013 20:52:12 -0700 (PDT) Received: from localhost.localdomain.localdomain ([119.119.225.132]) by mx.google.com with ESMTPSA id 6sm16261148pbn.45.2013.06.17.20.52.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Jun 2013 20:52:11 -0700 (PDT) From: Wang Shilong To: linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs-progs: do not print uuid 0 when printing root item Date: Tue, 18 Jun 2013 11:52:06 +0800 Message-Id: <1371527526-3691-1-git-send-email-wangshilong1991@gmail.com> X-Mailer: git-send-email 1.7.11.7 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.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Signed-off-by: Wang Shilong --- print-tree.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/print-tree.c b/print-tree.c index aae47a9..c1d8d18 100644 --- a/print-tree.c +++ b/print-tree.c @@ -355,8 +355,10 @@ static void print_root(struct extent_buffer *leaf, int slot) (unsigned long long)btrfs_root_generation(&root_item)); if (root_item.generation == root_item.generation_v2) { - uuid_unparse(root_item.uuid, uuid_str); - printf("\t\tuuid %s\n", uuid_str); + if (count_bytes(root_item.uuid, BTRFS_UUID_SIZE, 0) != BTRFS_UUID_SIZE) { + uuid_unparse(root_item.uuid, uuid_str); + printf("\t\tuuid %s\n", uuid_str); + } if (count_bytes(root_item.parent_uuid, BTRFS_UUID_SIZE, 0) != BTRFS_UUID_SIZE) { uuid_unparse(root_item.parent_uuid, uuid_str); printf("\t\tparent_uuid %s\n", uuid_str);