From patchwork Mon Oct 30 08:14:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Misono Tomohiro X-Patchwork-Id: 10032193 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 8CC9F603B4 for ; Mon, 30 Oct 2017 08:15:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CAB0285CE for ; Mon, 30 Oct 2017 08:15:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7187C2874A; Mon, 30 Oct 2017 08:15:14 +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 5805A28678 for ; Mon, 30 Oct 2017 08:15:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752266AbdJ3IPL (ORCPT ); Mon, 30 Oct 2017 04:15:11 -0400 Received: from mgwkm03.jp.fujitsu.com ([202.219.69.170]:55067 "EHLO mgwkm03.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752238AbdJ3IPK (ORCPT ); Mon, 30 Oct 2017 04:15:10 -0400 Received: from kw-mxoi2.gw.nic.fujitsu.com (unknown [192.168.231.133]) by mgwkm03.jp.fujitsu.com with smtp id 1a5e_de7e_d807ce22_6c5f_47c1_ade1_c614b6caf7a5; Mon, 30 Oct 2017 17:15:01 +0900 Received: from g01jpfmpwkw02.exch.g01.fujitsu.local (g01jpfmpwkw02.exch.g01.fujitsu.local [10.0.193.56]) by kw-mxoi2.gw.nic.fujitsu.com (Postfix) with ESMTP id 96306AC00C9 for ; Mon, 30 Oct 2017 17:15:01 +0900 (JST) Received: from g01jpexchkw35.g01.fujitsu.local (unknown [10.0.193.4]) by g01jpfmpwkw02.exch.g01.fujitsu.local (Postfix) with ESMTP id C30ED328646 for ; Mon, 30 Oct 2017 17:15:00 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.5.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20170217-enc X-SHieldMailCheckerMailID: d5f5b6b9463940319061923e21cbf363 Subject: [PATCH 2/2] btrfs-progs: show: allow fi show -u for FS_TREE From: "Misono, Tomohiro" To: linux-btrfs References: Message-ID: Date: Mon, 30 Oct 2017 17:14:57 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: 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 Allow "fi show -u" for uuid of top-level subvolume too for consistency. Signed-off-by: Tomohiro Misono --- btrfs-list.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index b6d7658..91fdab8 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -1594,9 +1594,15 @@ int btrfs_get_subvol(int fd, struct root_info *the_ri) ri = rb_entry(rbn, struct root_info, rb_node); rr = resolve_root(&rl, ri, root_id); if (rr == -ENOENT) { - ret = -ENOENT; - rbn = rb_next(rbn); - continue; + if (ri->root_id == BTRFS_FS_TREE_OBJECTID) { + ri->path = strdup("/"); + ri->name = strdup(""); + ri->full_path = strdup("/"); + } else { + ret = -ENOENT; + rbn = rb_next(rbn); + continue; + } } if (!comp_entry_with_rootid(the_ri, ri, 0) ||