From: Lennart Poettering <lennart@poettering.net>
To: Anand Jain <anand.jain@oracle.com>
Cc: kreijack@inwind.it, Andrei Borzenkov <arvidjaar@gmail.com>,
systemd-devel@lists.freedesktop.org, dsterba@suse.cz,
"linux-btrfs@vger.kernel.org >> linux-btrfs"
<linux-btrfs@vger.kernel.org>
Subject: Re: [systemd-devel] [survey] BTRFS_IOC_DEVICES_READY return status
Date: Mon, 15 Jun 2015 12:41:22 +0200 [thread overview]
Message-ID: <20150615104122.GA25616@gardel-login> (raw)
In-Reply-To: <557BF979.9040106@oracle.com>
On Sat, 13.06.15 17:35, Anand Jain (anand.jain@oracle.com) wrote:
> >>Are there any other users?
> >>
> >>> - If the the device in the argument is already mounted,
> >>> can it straightaway return 0 (ready) ? (as of now it would
> >>> again independently read the SB determine total_devices
> >>> and check against num_devices.
> >>>
> >>
> >>I think yes; obvious use case is btrfs mounted in initrd and later
> >>coldplug. There is no point to wait for anything as filesystem is
> >>obviously there.
> >>
>
> There is little difference. If the device is already mounted.
> And there are two device paths for the same device PA and PB.
> The path as last given to either 'btrfs dev scan (BTRFS_IOC_SCAN_DEV)'
> or 'btrfs device ready (BTRFS_IOC_DEVICES_READY)' will be shown
> in the 'btrfs filesystem show' or '/proc/self/mounts' output.
> It does not mean that btrfs kernel will close the first device path
> and reopen the 2nd given device path, it just updates the device path
> in the kernel.
The device paths shown in /proc/self/mountinfo is also weird in other
cases: if people boot up without initrd, and use a btrfs fs as root,
then it will always carry the string /dev/root in there, which is
completely useless, since such a device never exists in userspace or
/sys, and hence one cannot make sense of. Moreover, if one then asks
the kernel for the devices backing the btrfs fs via the ioctl it will
also return /dev/root for it, which is really useless.
I think in general I'd prefer if btrfs would stop returning the device
paths it got from userspace or the kernel, and would always return
sanitized ones that use the official kernel names for the devices in
them. Specifically, the member devices ioctl should always return
names like "/dev/sda5", even if I mount something using root= on the
kernel cmdline, or if I mount /dev/disks/by-uuid/.... via a symlink
instead of the real kernel name of the device.
Then, I think it would be a good idea to always update the device
string shown in /proc/self/mountinfo to be a concatenated version of
the list of device names reported by the ioctl. So that a btrfs RAID
would show "/dev/sda5:/dev/sdb6:/dev/sdc5" or so. And if I remove or
add backing devices the string really should be updated.
The btrfs client side tools then could use udev to get a list of the
device node symlinks for each device to help the user identifying
which backing devices belong to a btrfs pool.
Lennart
--
Lennart Poettering, Red Hat
next prev parent reply other threads:[~2015-06-15 10:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-12 13:16 [survey] BTRFS_IOC_DEVICES_READY return status Anand Jain
2015-06-12 18:04 ` [systemd-devel] " Andrei Borzenkov
2015-06-12 20:08 ` Goffredo Baroncelli
2015-06-13 9:35 ` Anand Jain
2015-06-13 15:09 ` Goffredo Baroncelli
[not found] ` <pan$63061$a3cdf5f6$a390adbd$e6097ad9@cox.net>
2015-06-14 19:44 ` Goffredo Baroncelli
2015-06-15 10:46 ` Lennart Poettering
2015-06-15 17:23 ` Goffredo Baroncelli
2015-06-15 17:38 ` Lennart Poettering
2015-06-17 19:10 ` Goffredo Baroncelli
2015-06-17 21:02 ` Lennart Poettering
2015-06-18 2:40 ` Andrei Borzenkov
2015-06-14 5:48 ` Andrei Borzenkov
2015-06-15 10:41 ` Lennart Poettering [this message]
2015-06-13 7:20 ` btrfs filesystem show confused when label is same as mountpoint Sjoerd
2015-06-13 9:51 ` Duncan
2015-06-25 16:37 ` David Sterba
2015-06-15 10:27 ` [survey] BTRFS_IOC_DEVICES_READY return status Lennart Poettering
2015-06-15 15:01 ` 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=20150615104122.GA25616@gardel-login \
--to=lennart@poettering.net \
--cc=anand.jain@oracle.com \
--cc=arvidjaar@gmail.com \
--cc=dsterba@suse.cz \
--cc=kreijack@inwind.it \
--cc=linux-btrfs@vger.kernel.org \
--cc=systemd-devel@lists.freedesktop.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