Bug 90281

Summary: systemd 219: tmpfiles.d: new "v" option fails on btrfs due to existing dir (not subvol)
Product: systemd Reporter: Duncan <1i5t5.duncan>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Duncan 2015-05-02 09:34:51 UTC
The 219 tmpfs.d documentation says "v" creates a subvolume if the path doesn't exist yet and the filesystem (btrfs) supports it, otherwise creating a normal directory in the same way as "d".

Unfortunately, it doesn't work that way, at least in 219.  An existing directory (not subvolume) on a read-only btrfs succeeded with 218's "d", but 219's replacement "d" fails.

In particular, 219 tmpfiles.d's new "v" option fails where 218's "d" option succeeds, triggering systemd-tmpfiles-setup failure, in the following case:

* tmpfiles.d/tmp.conf as shipped by 219 includes these lines:

v /tmp 1777 root root 10d
v /var/tmp 1777 root root 30d

* tmpfiles.d/var.conf as shipped by 219 includes this line:

v /var/lib/machines 0700 - - -


* / is btrfs and contains all three of the above as _directories_ (that is, not as subvolumes).

* / is mounted read-only by default and only mounted writable when I want to update it manually.


All three of the above fail with the following (as logged by syslog-ng after relay from journald):

May  1 19:35:59 h2 systemd-tmpfiles[434]: Failed to create directory or subvolume "/var/tmp": Read-only file system

May  1 19:35:59 h2 systemd-tmpfiles[434]: Failed to create directory or subvolume "/tmp": Read-only file system

May  1 19:35:59 h2 systemd-tmpfiles[434]: Failed to create directory or subvolume "/var/lib/machines": Read-only file system


But... the _directories_ exist, and the "v" documentation says that should be enough, just as it is for "d".


218's corresponding tmpfiles.d settings used "d" in place of "v", and it worked just fine (with /var/lib/container instead of machine, of course).


By way of explanation, I use btrfs, but prefer using entirely separate partitions to subvolumes and don't actually have any subvolumes (other than the ID 5 root subvolume) setup on any of my btrfs.  I want to keep it that way.

As I'm also affected by bug #90103 (networkd fails if IPv4 only), I've kept 219 masked (gentoo) and remain on 218, but it would be nice to have this fixed too by the time I can upgrade, so I don't have to deviate from the shipped tmp.conf and var.conf settings, changing "v" to "d".

Duncan
Comment 2 Duncan 2015-05-16 02:29:31 UTC
(In reply to Lennart Poettering from comment #1)
> Fixed in git:
> 
> http://cgit.freedesktop.org/systemd/systemd/commit/
> ?id=7b135a73999b6911ebb85c053b6f7701fdac1883

Thank you. =:^)

Duncan
Comment 3 Duncan 2015-05-23 12:17:05 UTC
Now tested and patch confirmed to fix it.

Thanks again. =:^)

Duncan

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.