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.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 7A5AFC433E0 for ; Tue, 16 Jun 2020 23:32:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54168207C4 for ; Tue, 16 Jun 2020 23:32:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=toxicpanda-com.20150623.gappssmtp.com header.i=@toxicpanda-com.20150623.gappssmtp.com header.b="QuSaGlUG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726387AbgFPXco (ORCPT ); Tue, 16 Jun 2020 19:32:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgFPXco (ORCPT ); Tue, 16 Jun 2020 19:32:44 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9421EC061573 for ; Tue, 16 Jun 2020 16:32:43 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id dp10so172345qvb.10 for ; Tue, 16 Jun 2020 16:32:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=J751bAyyLy3UrpT+hG0RJwX5/jzalty3iLsMBBScP5E=; b=QuSaGlUGJxWqMbY+wBVU9Id1LWKea6JxQdyWuzpkOeSWKFCOynvIZdfAdGy0NG2bU7 kSpwYWYrXEZ0ju7aoy06cbc9thbN06Uwaac5hH5noTm5GrOL3/+JjqZEX9Xl1VCzZQjH 5/4V/q+b4pxa//rUUrNZzUdRabHiUKln99bran78qeVrCp5m7jM+qzK2PUB0I7nNuYYG 9aNt/wOrNU9fhZpJj+eNUtYwZDhJ2OyJ+Ppb8Oid4QIhvvwD6TZCvaeAm/rlspLsTORv /HDEraEtQ5BmTKALG3yz9t4rer4KTTmYpAsTVfyn36NQfjdW1ax81cZ4UrJZdEFEZH8g c28A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=J751bAyyLy3UrpT+hG0RJwX5/jzalty3iLsMBBScP5E=; b=rOMGABBWMspDPYlLOegnu+QIho8yRe8CCtRUzoM+5difX0J6t0YxaDuuUDW5kqhDJR zdaLnEUQLEKHNyEP4dwuVk9ZIn6UskRcyi/Kfh3Rt4gGp1hn76J0QZMt/VCkDCMfKep4 xRX2nDq3uKH5+IDKwO6EiUxj7Ic/1j9dM8VFnLd1p/Xw2zrEH85qET5rUBzMJkX6utm4 HcKhN5yiPVycTZox8MPZ5oD5HAK9jfBts4etXoHNZqNvFzc7ygFPZh+I14XJkQk8OxMv emwXsy7KjcXzO1Cc9osate/WCwjRcrpGvyO98N7sPSmEZy1K2wVUniRXoe7gwsISL512 Zmxw== X-Gm-Message-State: AOAM53326gCuIy+8uJ8sh9PVmjyJ7BGXFdUqeVPLsI5ZaeNaI2WA/k6m goI/v7tMie00Y94rLmZgdmfZ/Qx8vYyU9A== X-Google-Smtp-Source: ABdhPJyww3tqv6jQpbugoeKZNjCaDFT/2gnF2V7vzPMlKxwlDw72Pf1PCElrxIBqiooLPpCTXG+Zlg== X-Received: by 2002:a0c:ecc6:: with SMTP id o6mr4806934qvq.243.1592350362486; Tue, 16 Jun 2020 16:32:42 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a8:11e8::123e? ([2620:10d:c091:480::1:458f]) by smtp.gmail.com with ESMTPSA id c4sm15517339qko.118.2020.06.16.16.32.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jun 2020 16:32:41 -0700 (PDT) Subject: Re: [PATCH 2/4] btrfs: detect uninitialized btrfs_root::anon_dev for user visible subvolumes To: Qu Wenruo , Qu Wenruo , linux-btrfs@vger.kernel.org References: <20200616021737.44617-1-wqu@suse.com> <20200616021737.44617-3-wqu@suse.com> From: Josef Bacik Message-ID: Date: Tue, 16 Jun 2020 19:32:41 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On 6/16/20 6:49 PM, Qu Wenruo wrote: > > > On 2020/6/17 上午3:25, Josef Bacik wrote: >> On 6/15/20 10:17 PM, Qu Wenruo wrote: >>> btrfs_root::anon_dev is an indicator for different subvolume namespaces. >>> Thus it should always be initialized to an anonymous block device. >>> >>> Add a safe net to catch such uninitialized values. >>> >>> Signed-off-by: Qu Wenruo >> >> Can we handle stat->dev not having a device set?  Or will this blow up >> in other ways?  Thanks, > > We can handle it without any problem, just users get confused. > > As a common practice, we use different bdev as a namespace for different > subvolumes. > Without a valid bdev, some user space tools may not be able to > distinguish inodes in different subvolumes. > Alright that's fine then. But I feel like stat is one of those things that'll flood the console, can we put this somewhere else that's going to be hit less? Thanks, Josef