dissect-image: open dissected or decrypted partitions and mount through the file...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 9 Sep 2022 20:44:27 +0000 (05:44 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Oct 2022 20:09:26 +0000 (05:09 +0900)
commitf7725647bb41c3398a867f139efe526efe8aa1b3
treeb5004dc982ed4aa5f67c13393eeb281448701dd5
parentf80015ff40bd6e17eccba3690b45335c5b11fad7
dissect-image: open dissected or decrypted partitions and mount through the file descriptor

If multiple services with the same encrypted image are simultaneously
starting, one may deactivate the dm device while others using it.
Or, similary, after (regular) partitions are dissected, another process
may try to remove them before we mount them.

To prevent such situations, let's keep the dissected and decrypted
partitions opened. Then, use the file descriptors when we mount the
partitions.

Fixes #24617.
src/shared/dissect-image.c
src/shared/dissect-image.h