Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: "Misono, Tomohiro" <misono.tomohiro@jp.fujitsu.com>
To: Anand Jain <anand.jain@oracle.com>, <dsterba@suse.cz>,
	<linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH v4 2/4] btrfs: cleanup btrfs_mount() using btrfs_mount_root()
Date: Wed, 17 Jan 2018 17:30:14 +0900	[thread overview]
Message-ID: <f96b3cf7-4853-465b-49a1-fa91f572228a@jp.fujitsu.com> (raw)
In-Reply-To: <2e0c866f-42e4-6a9c-a562-e3724062b0f9@oracle.com>



On 2018/01/16 20:45, Anand Jain wrote:
> 
> 
> On 01/16/2018 03:26 AM, David Sterba wrote:
>> On Fri, Jan 12, 2018 at 06:14:40PM +0800, Anand Jain wrote:
>>>
>>> Misono,
>>>
>>>    This change is causing subsequent (subvol) mount to fail when device
>>>    option is specified. The simplest eg for failure is ..
>>>      mkfs.btrfs -qf /dev/sdc /dev/sdb
>>>      mount -o device=/dev/sdb /dev/sdc /btrfs
>>>      mount -o device=/dev/sdb /dev/sdc /btrfs1
>>>         mount: /dev/sdc is already mounted or /btrfs1 busy
>>>
>>>     Looks like
>>>       blkdev_get_by_path() <-- is failing.
>>>       btrfs_scan_one_device()
>>>       btrfs_parse_early_options()
>>>       btrfs_mount()
>>>
>>>    Which is due to different holders (viz. btrfs_root_fs_type and
>>>    btrfs_fs_type) one is used for vfs_mount and other for scan,
>>>    so they form different holders and can't let EXCL open which
>>>    is needed for both scan and open.

BTW, I noticed "btrfs device scan/ready" fails for mounted filesystem
because of this reason. I will send a patch to fix this.
(Though I believe this is not the cause of the problem you mentioned.)

Thanks,
Tomohiro

>>
>> This looks close to what I see in the random test failures. I've
>> reverted your patch "btrfs: optimize move uuid_mutex closer to the
>> critical section" as I bisected to it. The uuid mutex around
>> blkdev_get_path probably protected the concurrent mount and scan so they
>> did not ask for EXCL at the same time.
>>
>> Reverting (or removing the patch from the current misc-next) queue is
>> simpler for me ATM as I want to get to a stable base now, we can add it
>> later if we understand the issue with the mount/scan.
> 
>   Right. I don't see above test case failing on your branch [1] which
>   does not have the uuid_mutex patch. Quite strange, there isn't any
>   concurrency (mount and scan) in this test case.
>   [1]
>     git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
> 
>   Ran xfstests, got stuck at btrfs/011 failures, (and will wait for
>   Liubo's v2 patch). OR is there any other test case you were referring
>   to as random test failures ?
> 
> Thanks, Anand
> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> 


  reply	other threads:[~2018-01-17  8:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14  8:23 [PATCH v4 0/4] btrfs: cleanup mount path Misono, Tomohiro
2017-12-14  8:24 ` [PATCH v4 1/4] btrfs: add btrfs_mount_root() and new file_system_type Misono, Tomohiro
2017-12-14  8:25 ` [PATCH v4 2/4] btrfs: cleanup btrfs_mount() using btrfs_mount_root() Misono, Tomohiro
2018-01-12 10:14   ` Anand Jain
2018-01-15  8:24     ` Misono, Tomohiro
2018-01-15 19:26     ` David Sterba
2018-01-16 11:45       ` Anand Jain
2018-01-17  8:30         ` Misono, Tomohiro [this message]
2018-01-18  4:48           ` Anand Jain
2018-01-18 16:26             ` David Sterba
2017-12-14  8:25 ` [PATCH v4 3/4] btrfs: split parse_early_options() in two Misono, Tomohiro
2017-12-14  8:25 ` [PATCH v4 4/4] btrfs: remove unused setup_root_args() Misono, Tomohiro
2017-12-14 14:21 ` [PATCH v4 0/4] btrfs: cleanup mount path 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=f96b3cf7-4853-465b-49a1-fa91f572228a@jp.fujitsu.com \
    --to=misono.tomohiro@jp.fujitsu.com \
    --cc=anand.jain@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /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