Potential race with systemd if /var/lib is an independent persistent unit

Bug #1845298 reported by Didier Roche-Tolomelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Native ZFS for Linux
New
Undecided
Unassigned
zfs-linux (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

If /var/lib is a dataset not under <pool>/ROOT/<root_dataset>, as proposed
 in the ubuntu root on zfs upstream guide
 (https://github.com/zfsonlinux/zfs/wiki/Ubuntu-18.04-Root-on-ZFS), we end up
 with a race where some services, like systemd-random-seed are writing under
 /var/lib, while zfs-mount is called. zfs mount will then potentially fail
 because of /var/lib isn't empty, and so, can't be mounted.
 Order those 2 units for now (more may be needed) as we can't declare
 virtually a provide mount point to match
 "RequiresMountsFor=/var/lib/systemd/random-seed" from
 systemd-random-seed.service.
 The optional generator for zfs 0.8 fixes it, but it's not enabled by default
 nor necessarily required.
 Example:
 - rpool/ROOT/ubuntu (mountpoint = /)
 - rpool/var/ (mountpoint = /var)
 - rpool/var/lib (mountpoint = /var/lib)

Both zfs-mount.service and systemd-random-seed.service are starting After=systemd-remount-fs.service. zfs-mount.service should be done before local-fs.target while systemd-random-seed.service should finish before sysinit.target (which is a later target).

Ideally, we would have a way for zfs mount -a unit to declare all paths or move systemd-random-seed after local-fs.target.

Upstream PR: https://github.com/zfsonlinux/zfs/pull/9360

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package zfs-linux - 0.8.1-1ubuntu12

---------------
zfs-linux (0.8.1-1ubuntu12) eoan; urgency=medium

  * Rename zsys-support.patch to 4000-zsys-support.patch
  * debian/patches/4500-fix-generator-invalid-cache.patch:
    - Regenerate cache file if empty to fix a race for the mount
      generator and fstab which contains /boot/grub (LP: #1845606)
  * debian/patches/4501-fix-var-lib-race.patch:
    - Fix a race between systemd-random-seed and zfs mount -a if
      /var/lib is a separate persistent dataset. (LP: #1845298)

 -- Didier Roche <email address hidden> Fri, 27 Sep 2019 09:48:23 +0200

Changed in zfs-linux (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.