All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Josef Bacik <josef@toxicpanda.com>,
	dsterba@suse.cz, linux-btrfs@vger.kernel.org,
	syzbot+4cfe71a4da060be47502@syzkaller.appspotmail.com
Subject: Re: [PATCH add reported by] btrfs: fix rw_devices count in __btrfs_free_extra_devids
Date: Tue, 6 Oct 2020 21:12:18 +0800	[thread overview]
Message-ID: <6a59bb52-1603-74ca-9bd8-7b30888a4842@oracle.com> (raw)
In-Reply-To: <7b481788-110e-b2a7-607c-2f443f30f663@toxicpanda.com>

On 25/9/20 10:28 pm, Josef Bacik wrote:
> On 9/25/20 6:11 AM, Anand Jain wrote:
>> On 24/9/20 10:02 pm, Josef Bacik wrote:
>>> On 9/24/20 7:25 AM, David Sterba wrote:
>>>> On Wed, Sep 23, 2020 at 09:42:17AM -0400, Josef Bacik wrote:
>>>>> On 9/23/20 12:42 AM, Anand Jain wrote:
>>>>>> On 22/9/20 9:08 pm, Josef Bacik wrote:
>>>>>>> On 9/22/20 8:33 AM, Anand Jain wrote:
>>>>
>>>>> Yeah I mean we do something in btrfs_init_dev_replace(), like when 
>>>>> we search for
>>>>> the key, we double check to make sure we don't have a devid ==
>>>>> BTRFS_DEV_REPLACE_DEVID in our devices if we don't find a key. 
>>
>>
>>>>> If we do we
>>>>> return -EIO and bail out of the mount.  Thanks,
>>
>>
>> I read fast and missed the bailout part before.
>>
>> If we bailout the mount, it means a btrfs rootfs can fail to boot up.
>>
>> To recover from it, the user has to remove the trespassing/extra device
>> manually and reboot.
>> For a non-rootfs, the user would have to remove the device manually 
>> and run
>> 'btrfs dev scan --forget' to free up the extra devices.
>> What we are doing now is removing the extra/trespassing device
>> internally.
>>
>> IMO. The case of trespassing/extra device trying to sabotage the setup
>> is a bit different from a corrupted device, in the former case
>> resilience is preferred?
>>
> 
> Well this doesn't happen in real life right?  This is purely from a 
> fuzzing standpoint, so while resilience should be the first thing we 
> shoot for, I'd rather not spend a long time trying to make it work.
> 
> In the case of just randomly deleting a device, I don't think that's a 
> decision that the kernel can/should make, we should require a user to 
> intervene at that point.  That makes failure the best option here, thanks,
> 

  It makes sense to me, its different from what we had before.
  Made those changes in v2.

Thanks, Anand

> Josef


  reply	other threads:[~2020-10-06 13:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22 12:30 [PATCH] btrfs: fix rw_devices count in __btrfs_free_extra_devids Anand Jain
2020-09-22 12:33 ` [PATCH add reported by] " Anand Jain
2020-09-22 13:08 ` Josef Bacik
2020-09-23  4:42   ` Anand Jain
2020-09-23 13:42     ` Josef Bacik
2020-09-24  5:19       ` Anand Jain
2020-09-24 11:25       ` David Sterba
2020-09-24 14:02         ` Josef Bacik
2020-09-25 10:11           ` Anand Jain
2020-09-25 14:28             ` Josef Bacik
2020-10-06 13:12               ` Anand Jain [this message]
2020-09-22 12:33 Anand Jain
2020-10-06 13:08 ` [PATCH] btrfs: fix devid 0 without a replace item by failing the mount Anand Jain
2020-10-06 13:12   ` [PATCH v2] " Anand Jain
2020-10-06 14:54   ` [PATCH] " kernel test robot
2020-10-06 14:54     ` kernel test robot
2020-10-07  2:07     ` Anand Jain
2020-10-07  2:07       ` Anand Jain
2020-10-12  2:51       ` [kbuild-all] " Rong Chen
2020-10-12  2:51         ` Rong Chen
2020-10-06 16:44   ` kernel test robot
2020-10-06 16:44     ` kernel test robot
2020-10-06 13:12 [PATCH v2] " Anand Jain
2020-10-12  5:26 ` [PATCH v2 add prerequisite-patch-id] " Anand Jain
2020-10-21  4:02   ` [PATCH RESEND " Anand Jain
2020-10-12  5:36   ` [PATCH " Anand Jain
2020-10-21  5:49   ` [PATCH RESEND " kernel test robot
2020-10-21  5:49     ` kernel test robot

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=6a59bb52-1603-74ca-9bd8-7b30888a4842@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=syzbot+4cfe71a4da060be47502@syzkaller.appspotmail.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.