moby/volume/local
Paweł Gronowski c35376c455
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>
(cherry picked from commit 2689484402)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-29 19:59:05 +02:00
..
local.go volume/local: Don't unmount, restore mounted status 2023-08-29 19:59:05 +02:00
local_linux_test.go volume/local.Create(): validate early 2022-06-03 00:34:21 +02:00
local_test.go volume: fix empty-lines (revive) 2022-09-28 01:58:50 +02:00
local_unix.go volume/local: Don't unmount, restore mounted status 2023-08-29 19:59:05 +02:00
local_windows.go volume/local: Don't unmount, restore mounted status 2023-08-29 19:59:05 +02:00