]> git.ipfire.org Git - thirdparty/systemd.git/commit
mount-util: Compact list of sub mounts after dropping
authorKai Lüke <kai@amutable.com>
Wed, 29 Apr 2026 13:04:51 +0000 (22:04 +0900)
committerKai Lüke <pothos@users.noreply.github.com>
Fri, 10 Jul 2026 01:34:54 +0000 (03:34 +0200)
commit7eabeaed0e6495ff74bc5f6cce98ec8209cef540
treeea674a1fd975bedce5b87f6d0e44935bcc7960b2
parentb5102ae48ef91ee19d3865d1b3244c6b9e0bfb3d
mount-util: Compact list of sub mounts after dropping

When nested mounts appear under a sysext hierarchy like this:
  mkdir -p /opt/trigger/
  mount -t tmpfs tmpfs /opt/trigger
  mkdir -p /opt/trigger/inner
  mount -t tmpfs tmpfs /opt/trigger/inner
Then systemd-sysext merge hit an assertion reported in
https://github.com/flatcar/Flatcar/issues/2111 because when it iterates
over the list of sub mounts it doesn't expect entries with NULL in the
path from the dropped entries.
Instead of having to deal with entries with path NULL, better sort the
holes from dropping to the end and then reduce the array length.
src/shared/mount-util.c
src/test/test-mount-util.c