linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: "Misono, Tomohiro" <misono.tomohiro@jp.fujitsu.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix inconsistency during missing device rejoin
Date: Fri, 15 Dec 2017 16:03:23 +0800	[thread overview]
Message-ID: <6bd7662e-a056-45c2-8270-312375328ab8@oracle.com> (raw)
In-Reply-To: <3aeb59b8-3ccf-6657-fcf4-167e9c977230@oracle.com>





>>> @@ -715,7 +715,8 @@ static noinline int device_list_add(const char 
>>> *path,
>>>           ret = 1;
>>>           device->fs_devices = fs_devices;
>>> -    } else if (!device->name || strcmp(device->name->str, path)) {
>>> +    } else if (!device->name || strcmp(device->name->str, path) ||
>>> +            test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state)) {
>>>           /*
>>>            * When FS is already mounted.
>>>            * 1. If you are here and if the device->name is NULL that
>>>
>>
>> I read the comments below this and wonder if BTRFS_DEV_STATE_MISSING 
>> is set
>> when device->name is null and therefore the first condition can be 
>> removed.

  On the 2nd thought, actually can not remove device->name, there can
  be a case where degraded FS is unmounted, then device->name is NULL.

Thanks, Anand

>   device->name is null only when missing is set.
> 
>   Will do this optimize in a new patch, as its about clean up and
>   is not about fixing inconsistency as in here.
> 
> Thanks, Anand

  reply	other threads:[~2017-12-15  8:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04  7:19 [PATCH] btrfs: fix inconsistency during missing device rejoin Anand Jain
2017-12-05  2:18 ` Misono, Tomohiro
2017-12-05  2:53   ` Anand Jain
2017-12-15  8:03     ` Anand Jain [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-12-04  4:43 Anand Jain

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=6bd7662e-a056-45c2-8270-312375328ab8@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=misono.tomohiro@jp.fujitsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).