moby/volume
Paweł Gronowski 2689484402
volume/local: Don't unmount, restore mounted status
On startup all local volumes were unmounted as a cleanup mechanism for
the non-clean exit of the last engine process.

This caused live-restored volumes that used special volume opt mount
flags to be broken. While the refcount was restored, the _data directory
was just unmounted, so all new containers mounting this volume would
just have the access to the empty _data directory instead of the real
volume.

With this patch, the mountpoint isn't unmounted. Instead, if the volume
is already mounted, just mark it as mounted, so the next time Mount is
called only the ref count is incremented, but no second attempt to mount
it is performed.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-08-29 14:16:37 +02:00
..
drivers volume/drivers: use plugin Content-Type headers v1.2 2023-08-07 20:38:54 +02:00
local volume/local: Don't unmount, restore mounted status 2023-08-29 14:16:37 +02:00
mounts test/volume: Replace Check with NilError where suitable 2023-08-10 11:18:56 +02:00
service test/volume: Replace Check with NilError where suitable 2023-08-10 11:18:56 +02:00
testutils linting: gosec: fix or suppress G112, G114 in test code 2022-09-04 15:36:51 +02:00
volume.go Restore active mount counts on live-restore 2023-06-27 16:33:23 +00:00