On Sun, Jan 28, 2018 at 1:06 AM, Andrei Borzenkov <arvidj...@gmail.com> wrote: > 27.01.2018 18:22, Duncan пишет: >> Adam Borowski posted on Sat, 27 Jan 2018 14:26:41 +0100 as excerpted: >> >>> On Sat, Jan 27, 2018 at 12:06:19PM +0100, Tomasz Pala wrote: >>>> On Sat, Jan 27, 2018 at 13:26:13 +0300, Andrei Borzenkov wrote: >>>> >>>>>> I just tested to boot with a single drive (raid1 degraded), even >>>>>> with degraded option in fstab and grub, unable to boot ! The boot >>>>>> process stop on initramfs. >>>>>> >>>>>> Is there a solution to boot with systemd and degraded array ? >>>>> >>>>> No. It is finger pointing. Both btrfs and systemd developers say >>>>> everything is fine from their point of view. >>> >>> It's quite obvious who's the culprit: every single remaining rc system >>> manages to mount degraded btrfs without problems. They just don't try >>> to outsmart the kernel. >> >> No kidding. >> >> All systemd has to do is leave the mount alone that the kernel has >> already done, > > Are you sure you really understand the problem? No mount happens because > systemd waits for indication that it can mount and it never gets this > indication.
"not ready" is rather vague terminology but yes that's how systemd ends up using the ioctl this rule depends on, even though the rule has nothing to do with readiness per se. If all devices for a volume aren't found, we can correctly conclude a normal mount attempt *will* fail. But that's all we can conclude. What I can't parse in all of this is if the udev rule is a one shot, if the ioctl is a one shot, if something is constantly waiting for "not all devices are found" to transition to "all devices are found" or what. I can't actually parse the two critical lines in this rule. I $ cat /usr/lib/udev/rules.d/64-btrfs.rules # do not edit this file, it will be overwritten on update SUBSYSTEM!="block", GOTO="btrfs_end" ACTION=="remove", GOTO="btrfs_end" ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end" # let the kernel know about this btrfs filesystem, and check if it is complete IMPORT{builtin}="btrfs ready $devnode" # mark the device as not ready to be used by the system ENV{ID_BTRFS_READY}=="0", ENV{SYSTEMD_READY}="0" LABEL="btrfs_end" ---- And udev builtin btrfs, which I guess the above rule is referring to: https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-btrfs.c I think the Btrfs ioctl is a one shot. Either they are all present or not. The waiting is a policy by systemd udev rule near as I can tell. -- Chris Murphy -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html