[PATCH 0/2][SRU][F] systemd mount units fail during boot, while file system is correctly mounted

Heitor Alves de Siqueira halves at canonical.com
Thu Aug 10 17:04:56 UTC 2023


BugLink: https://bugs.launchpad.net/bugs/1837227

Hi kernel-team,

Users have reported systemd mount failures causing their systems to boot into
emergency mode, even though the file systems seem to be correctly mounted. This
is fixed by the systemd commit mentioned below, but it has a hard-dependency on
cursor support for /proc/mounts.

I've cherry-picked two kernel patches that are necessary for this to work: the
list_for_each_continue() patch isn't a hard requirement, but including it makes
the cursor patch apply cleanly with minimal offset changes. We've had affected
users test these kernel commits independently of a fixed systemd package, and
they haven't reported any issues on their own (i.e. these patches shouldn't
break the kernel on non-patched systemd builds, and vice versa).

The kernel commits were introduced in v5.6 and v5.8, so releases newer than
Focal are already fixed.

[Impact]
 * systemd mount units fail during boot, and the system boots into emergency mode
 * caused by systemd not handling mounts that are MOUNT_MOUNTING when receiving signals

[Fix]
 * Fixed by systemd patch:
   - 01400460ae16 core/mount: adjust deserialized state based on /proc/self/mountinfo
 * Fixed by kernel patch:
   - 9f6c61f96f2d proc/mounts: add cursor

[Test Case]
  * Using rep-tmpfs.sh script from BugLink, no failures should be reported for all test variants

Miklos Szeredi (1):
  proc/mounts: add cursor

Pavel Begunkov (1):
  list: introduce list_for_each_continue()

 fs/mount.h            | 12 ++++--
 fs/namespace.c        | 91 +++++++++++++++++++++++++++++++++++--------
 fs/proc_namespace.c   |  4 +-
 include/linux/list.h  | 10 +++++
 include/linux/mount.h |  4 +-
 5 files changed, 100 insertions(+), 21 deletions(-)

-- 
2.41.0




More information about the kernel-team mailing list