From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00DB3C28D18 for ; Wed, 5 Jun 2019 16:19:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D62BA2075C for ; Wed, 5 Jun 2019 16:19:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728713AbfFEQTr (ORCPT ); Wed, 5 Jun 2019 12:19:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:58258 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728666AbfFEQTp (ORCPT ); Wed, 5 Jun 2019 12:19:45 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 76BF6AD85 for ; Wed, 5 Jun 2019 16:19:44 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id D5F05DA866; Wed, 5 Jun 2019 18:20:35 +0200 (CEST) Date: Wed, 5 Jun 2019 18:20:35 +0200 From: David Sterba To: Nikolay Borisov Cc: linux-btrfs@vger.kernel.org Subject: Re: [PATCH 1/2] btrfs-progs: Correctly open filesystem on image file Message-ID: <20190605162035.GE9896@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Nikolay Borisov , linux-btrfs@vger.kernel.org References: <20190516131250.26621-1-nborisov@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190516131250.26621-1-nborisov@suse.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Thu, May 16, 2019 at 04:12:49PM +0300, Nikolay Borisov wrote: > When btrfs' 'filesystem' subcommand is passed path to an image file it > currently fails since the code expects the image file is going to be > recognised by libblkid (called from btrfs_scan_devices()). This is not > the case since libblkid only scan well-known locations under /dev. > > Fix this by explicitly calling open_ctree which will correctly open > the image and add it to the correct btrfs_fs_devices struct. This allows > subsequent cmd_filesystem_show logic to correctly show requested > information. > > Signed-off-by: Nikolay Borisov Applied, thanks.