All of lore.kernel.org
 help / color / mirror / Atom feed
* [survey]  BTRFS_IOC_DEVICES_READY return status
@ 2015-06-12 13:16 Anand Jain
  2015-06-12 18:04 ` [systemd-devel] " Andrei Borzenkov
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Anand Jain @ 2015-06-12 13:16 UTC (permalink / raw)
  To: systemd-devel, linux-btrfs@vger.kernel.org >> linux-btrfs
  Cc: lennart, dsterba



BTRFS_IOC_DEVICES_READY is to check if all the required devices
are known by the btrfs kernel, so that admin/system-application
could mount the FS. It is checked against a device in the argument.

However the actual implementation is bit more than just that,
in the way that it would also scan and register the device
provided in the argument (same as btrfs device scan subcommand
or BTRFS_IOC_SCAN_DEV ioctl).

So BTRFS_IOC_DEVICES_READY ioctl isn't a read/view only ioctl,
but its a write command as well.

Next, since in the kernel we only check if total_devices
(read from SB)  is equal to num_devices (counted in the list)
to state the status as 0 (ready) or 1 (not ready). But this
does not work in rest of the device pool state like missing,
seeding, replacing since total_devices is actually not equal
to num_devices in these state but device pool is ready for
the mount and its a bug which is not part of this discussions.


Questions:

  - Do we want BTRFS_IOC_DEVICES_READY ioctl to also scan and
    register the device provided (same as btrfs device scan
    command or the BTRFS_IOC_SCAN_DEV ioctl)
    OR can BTRFS_IOC_DEVICES_READY be read-only ioctl interface
    to check the state of the device pool. ?

  - 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.

  - What should be the expected return when the FS is mounted
    and there is a missing device.


Thanks, Anand

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: btrfs filesystem show confused when label is same as mountpoint
@ 2015-06-13  9:50 Anand Jain
  2015-06-13 15:01 ` Sjoerd
  0 siblings, 1 reply; 21+ messages in thread
From: Anand Jain @ 2015-06-13  9:50 UTC (permalink / raw)
  To: Sjoerd; +Cc: BTRFS



I don't see that in 4.0, could you upgrade/try. thanks

---------------
mount /dev/sdf /data/Multimedia

btrfs fi show /data/Multimedia
Label: 'MULTIMEDIA'  uuid: 9b49bcc9-66d9-4f76-a57a-a60e2a16f15d
	Total devices 1 FS bytes used 192.00KiB
	devid    1 size 2.90GiB used 333.12MiB path /dev/sdf

btrfs-progs v4.0.1-2-ge8ceb61

btrfs fi show MULTIMEDIA
Label: 'MULTIMEDIA'  uuid: 9b49bcc9-66d9-4f76-a57a-a60e2a16f15d
	Total devices 1 FS bytes used 192.00KiB
	devid    1 size 2.90GiB used 333.12MiB path /dev/sdf

btrfs-progs v4.0.1-2-ge8ceb61
---------------

Anand


On 06/13/2015 03:20 PM, Sjoerd wrote:> Hi,
 >
 > I've a btrfs partition with label 'MULTIMEDIA' (all capitals) and 
mounted it
 > on /data/Multimedia (only M capital) and see the following when doing 
a btrfs
 > fi show:
 >
 > for mountpoint:
 > btrfs fi show /data/Multimedia
 > Btrfs v3.17
 >
 > versus for label:
 > btrfs fi show MULTIMEDIA
 > Label: 'MULTIMEDIA'  uuid: ce5d23cd-73a4-4f7c-83cd-2c40d12f6697
 >          Total devices 4 FS bytes used 5.04TiB
 >          devid    1 size 1.48TiB used 1.26TiB path /dev/sda2
 >          devid    2 size 1.48TiB used 1.26TiB path /dev/sdc2
 >          devid    3 size 1.48TiB used 1.26TiB path /dev/sdd2
 >          devid    4 size 1.48TiB used 1.26TiB path /dev/sde2
 >
 >
 > So in the latter case I get the results I was looking for.
 >
 >
 > It's not realy a question, but I couldn't find anything on the 
bugtracker (if
 > it's a bug in the first place) or a known something, so just to let you
 > know,cause I took me awhile to figure out why I didn't get results 
for this
 > particular mountpoint, while for others I did ;)
 >
 > Cheers,
 > Sjoerd
 >
 > --
 > 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
 >

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2015-06-25 16:37 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
2015-06-13  9:50 btrfs filesystem show confused when label is same as mountpoint Anand Jain
2015-06-13 15:01 ` Sjoerd

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.