All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: Josef Bacik <josef@toxicpanda.com>,
	Qu Wenruo <quwenruo.btrfs@gmx.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/4] btrfs: detect uninitialized btrfs_root::anon_dev for user visible subvolumes
Date: Wed, 17 Jun 2020 07:49:33 +0800	[thread overview]
Message-ID: <0e274dc7-ac05-078a-2a2c-348e72745d45@suse.com> (raw)
In-Reply-To: <a7417666-56a0-be6a-1691-e647802e1df7@toxicpanda.com>



On 2020/6/17 上午7:32, Josef Bacik wrote:
> 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 <wqu@suse.com>
>>>
>>> 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,

Unfortunately, stat() is the only user of btrfs_root::anon_dev.

While fortunately, the logical is pretty simple, even without the safe
net we can understand the lifespan pretty well.

I'm fine to drop this patch if you're concerned about the possible
warning flood, as the benefit is really not that much.

Thanks,
Qu

> 
> Josef

  reply	other threads:[~2020-06-16 23:49 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16  2:17 [PATCH 0/4] btrfs: workaround exhausted anonymous block device pool Qu Wenruo
2020-06-16  2:17 ` [PATCH 1/4] btrfs: disk-io: don't allocate anonymous block device for user invisible roots Qu Wenruo
2020-06-16 19:21   ` Josef Bacik
2020-06-16  2:17 ` [PATCH 2/4] btrfs: detect uninitialized btrfs_root::anon_dev for user visible subvolumes Qu Wenruo
2020-06-16 19:25   ` Josef Bacik
2020-06-16 22:49     ` Qu Wenruo
2020-06-16 23:32       ` Josef Bacik
2020-06-16 23:49         ` Qu Wenruo [this message]
2020-06-17 11:31           ` David Sterba
2020-06-17 13:37             ` Josef Bacik
2020-06-17 23:39               ` Qu Wenruo
2020-06-16  2:17 ` [PATCH 3/4] btrfs: preallocate anon_dev for subvolume and snapshot creation Qu Wenruo
2020-06-16 15:10   ` David Sterba
2020-06-16 22:54     ` Qu Wenruo
2020-07-01  3:25     ` Qu Wenruo
2020-07-01 17:39       ` David Sterba
2020-07-01 23:56         ` Qu Wenruo
2020-07-02 16:08           ` David Sterba
2020-07-02 23:46             ` David Sterba
2020-07-03  5:19               ` Qu Wenruo
2020-07-03 12:29                 ` David Sterba
2020-07-03 12:39                   ` Qu Wenruo
2020-06-16  2:17 ` [PATCH 4/4] btrfs: free anon_dev earlier to prevent exhausting anonymous block device pool Qu Wenruo
2020-06-16 19:23   ` Josef Bacik
2020-06-16 22:48     ` David Sterba
2020-06-16 23:31       ` Josef Bacik
2020-06-30 14:14 ` [PATCH 0/4] btrfs: workaround exhausted " David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0e274dc7-ac05-078a-2a2c-348e72745d45@suse.com \
    --to=wqu@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.