Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(RHEL-6210) units: introduce [email protected] for properly ordering mounts/swaps #429

Closed

Conversation

msekletar
Copy link
Member

@msekletar msekletar commented Feb 14, 2024

No description provided.

(cherry picked from commit 33a4c98)

Related: RHEL-6210
(cherry picked from commit 49685fb)

Related: RHEL-6210
@github-actions github-actions bot added tracker/missing Formerly needs-bz pr/needs-ci Formerly needs-ci pr/needs-review Formerly needs-review labels Feb 14, 2024
Copy link

github-actions bot commented Feb 14, 2024

Commit validation

Tracker - RHEL-6210

The following commits meet all requirements

commit upstream
0fd0a66 - fstab-generator: line break a bit more systematically systemd/systemd@33a4c98
feb1a3f - cryptsetup-generator: break overly long line systemd/systemd@49685fb
637b446 - cryptsetup-generator: order after cryptsetup-pre.target unconditionall… systemd/systemd@6bbd539
d41041c - units: introduce [email protected] for properly ordering mounts/swaps a… systemd/systemd@a7e8855
176d2d0 - core: drop pure from static functions systemd/systemd@219f3cd
65253d8 - core: let's be defensive, /dev/nfs is also a special mount source, fil… systemd/systemd@5de0acf
4352ec1 - swap: generate automatic dependencies also for /proc/swaps devices systemd/systemd@61f9cf4
82ac25d - core: downgrade swap → device dep to Requires= systemd/systemd@e3e6f99
fef098e - core: add implicit ordering dep on [email protected] from all mount uni… systemd/systemd@44b0d1f
c964726 - man: document [email protected] systemd/systemd@68bda07
7311a36 - man: tweak description of [email protected] systemd/systemd@8e92d92
7991312 - units: don't stop [email protected] unit at shutdown systemd/systemd@d120ce4
4f26150 - units/[email protected]: conflict with umount.target systemd/systemd@99f360a

Tracker validation

Success

🟢 Tracker RHEL-6210 has set desired product: rhel-8.8.0
🟢 Tracker RHEL-6210 has set desired component: systemd
🟢 Tracker RHEL-6210 has been approved


Pull Request validation

Failed

🔴 Failed or pending checks - build (stream8, GCC_ASAN)[failure],build (stream8, GCC)[failure]
🔴 Review - Missing review from a member

src/cryptsetup/cryptsetup-generator.c Fixed Show fixed Hide fixed
src/shared/generator.c Dismissed Show dismissed Hide dismissed
…against cryptsetup

Let's hook it into both cryptsetup-generator and gpt-auto-generator with
a shared implementation in generator.c

Fixes: #8472
(cherry picked from commit a7e8855)

Related: RHEL-6210
For static functions the compiler should figure this out on its own.

(cherry picked from commit 219f3cd)

Related: RHEL-6210
…lter it out

(cherry picked from commit 5de0acf)

Related: RHEL-6210
This catches up with the logic we do for mounts: we create deps based on
/proc/swaps now too, with the right flags set.

(cherry picked from commit 61f9cf4)

Related: RHEL-6210
This catches up with 9d06297 and adapts
the change made to swap units. We generally don't want to react
a-posteriori to swap devices disappearing, bad things will happen
anyway.

(cherry picked from commit e3e6f99)

Related: RHEL-6210
This way we shuld be able to order mounts properly against their backing
services in case complex storage is used (i.e. LUKS), even if the device
path used for mounting the devices is different from the expected device
node of the backing service.

Specifically, if we have a LUKS device /dev/mapper/foo that is mounted
by this name all is trivial as the relationship can be established a
priori easily. But if it is mounted via a /dev/disk/by-uuid/ symlink or
similar we only can relate the device node generated to the one mounted
at the moment the device is actually established. That's because the
UUID of the fs is stored inside the encrypted volume and thus not
knowable until the volume is set up. This patch tries to improve on this
situation: a implicit [email protected] dependency is generated for
all mounts, based on the data from /proc/self/mountinfo, which should be
the actual device node, with all symlinks resolved. This means that as
soon as the mount is established the ordering via [email protected] will
work, and that means during shutdown it is honoured, which is what we
are looking for.

Note that specifying /etc/fstab entries via UUID= for LUKS devices still
sucks and shouldn't be done, because it means we cannot know which LUKS
device to activate to make an fs appear, and that means unless the
volume is set up at boot anyway we can't really handle things
automatically when putting together transactions that need the mount.

(cherry picked from commit 44b0d1f)

Related: RHEL-6210
(cherry picked from commit 68bda07)

Related: RHEL-6210
@github-actions github-actions bot removed the pr/needs-ci Formerly needs-ci label Feb 15, 2024
@github-actions github-actions bot added tracker/unapproved Formerly needs-acks pr/needs-ci Formerly needs-ci and removed tracker/missing Formerly needs-bz labels Mar 11, 2024
keszybz and others added 3 commits March 11, 2024 16:09
In particular, let's just say "is" and "must" instead of "may be" and
"should". The weaker forms are obviously correct, but the text is easier to
understand if non-conditional forms are used.

(cherry picked from commit 8e92d92)

Related: RHEL-6210
We want that cryptsetup/veritysetup devices can stick around until the
very end, as well as the users of them which might depend on
[email protected] for the devices. Hence leave the targets around till
the very end.

Note that their runtime is managed via StopWhenUnneeded= anyway, hence
unless their are volumes that actually survive still the very end they
target units will still be stopped.

(cherry picked from commit d120ce478dc0043c89899799b5c1aaf62901bea9)

Related: RHEL-6210
Follow-up for d120ce478dc0043c89899799b5c1aaf62901bea9

[email protected] is used as a synchronization point between
the mount unit and corresponding [email protected].
After the mentioned commit, it doesn't get a stop job enqueued
during shutdown, and thus the stop job for [email protected]
could be run before the mount unit is stopped.

Therefore, let's make [email protected] conflict with umount.target,
which is also what [email protected] does.

Fixes #29336

(cherry picked from commit 99f360a46b6304d87a483be8e09d5e5176be13aa)

Related: RHEL-6210
@github-actions github-actions bot added tracker/missing Formerly needs-bz and removed tracker/missing Formerly needs-bz labels Apr 12, 2024
@github-actions github-actions bot removed the tracker/unapproved Formerly needs-acks label Jun 7, 2024
@msekletar msekletar closed this Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/needs-ci Formerly needs-ci pr/needs-review Formerly needs-review rhel-8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants