From: Josef Bacik <jbacik@fusionio.com>
To: Kay Sievers <kay@vrfy.org>
Cc: btrfs <linux-btrfs@vger.kernel.org>,
Lennart Poettering <lennart@poettering.net>,
Harald Hoyer <harald@redhat.com>
Subject: Re: BTRFS_IOC_DEVICES_READY and removed devices
Date: Tue, 18 Sep 2012 09:09:03 -0400 [thread overview]
Message-ID: <20120918130903.GA2272@localhost.localdomain> (raw)
In-Reply-To: <CAPXgP10p_26o3Xw9UEqaPs5=1VAZNkFqZnkXmphzvapcSca5ZQ@mail.gmail.com>
On Mon, Sep 17, 2012 at 04:46:08PM -0600, Kay Sievers wrote:
> We are currently playing around with native btrfs multi-device support
> in systemd. We already committed the needed pieces to systemd git, to
> register all detected btrfs filesystems with the kernel.
>
> For volumes which are listed in fstab for mounting, we delay the
> actual mount-attempt of a multi-device volume until we see READY
> returned from BTRFS_IOC_DEVICES_READY. A line with UUID= in /etc/fstab
> with "nofail" in the options field, and we can boot up without any
> device plugged in. Now plugging in devices one-after-the-other until
> the volume has a full tree of devices; with the last device there,
> systemd just mounts the volume as expected.
>
> This seems to work very well so far, unless a device which is already
> registered disappears, which is a kind of valid hotplug scenario we
> should handle better:
>
> If one device of a 2-device volume is registered with the in-kernel
> cache, and then the device is unplugged from the system, the cache
> state does not get updated. If then the other device of the 2-device
> volume is registered, BTRFS_IOC_DEVICES_READY indicates ready; but in
> fact only one of two needed devices are available at that time, and
> mounting fails.
>
> Can we somehow subscribe to device media-changes/removal to prevent
> the stale device state in the in-kernel cache?
>
> Or alternatively make BTRFS_IOC_DEVICES_READY re-validate all involved
> block devices before it returns READY?
Hrm excellent question, I'll look at what options we have in kernel to check and
see if a device is still present and figure something out. Thanks,
Josef
prev parent reply other threads:[~2012-09-18 13:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-17 22:46 BTRFS_IOC_DEVICES_READY and removed devices Kay Sievers
2012-09-18 13:09 ` Josef Bacik [this message]
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=20120918130903.GA2272@localhost.localdomain \
--to=jbacik@fusionio.com \
--cc=harald@redhat.com \
--cc=kay@vrfy.org \
--cc=lennart@poettering.net \
--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;
as well as URLs for NNTP newsgroup(s).