moby/daemon/graphdriver
Mike Sul 1728815648
daemon: overlay2: Write layer metadata atomically
When the daemon process or the host running it is abruptly terminated,
the layer metadata file can become inconsistent on the file system.
Specifically, `link` and `lower` files may exist but be empty, leading
to overlay mounting errors during layer extraction, such as:
"failed to register layer: error creating overlay mount to <path>:
too many levels of symbolic links."

This commit introduces the use of `AtomicWriteFile` to ensure that the
layer metadata files contain correct data when they exist on the file system.

Signed-off-by: Mike <mike.sul@foundries.io>
(cherry picked from commit de2447c2ab)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-23 20:19:13 +02:00
..
aufs daemon/graphdriver: use strconv instead of fmt.Sprintf 2023-01-10 10:45:58 +01:00
btrfs graphdriver/btrfs: needs kernel headers >= 4.12, not >= 4.7 2023-01-10 10:46:26 +01:00
copy d/graphdriver/copy: support src fs w/o xattr support 2023-05-04 15:28:04 -04:00
devmapper daemon/graphdriver/devicemapper: simplify Udev log, and update link 2022-12-31 17:02:30 +01:00
fuse-overlayfs Finish refactor of UID/GID usage to a new struct 2022-03-14 16:28:57 -04:00
graphtest daemon/graphdriver: fix empty-lines (revive) 2022-09-30 23:59:31 +02:00
overlay pkg/fsutils: deprecate in favor of containerd/continuity/fs 2022-10-05 23:52:55 +02:00
overlay2 daemon: overlay2: Write layer metadata atomically 2023-10-23 20:19:13 +02:00
overlayutils overlay2: account for UserNS/userxattr in metacopy test 2022-05-17 06:58:50 -06:00
register Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
vfs golangci-lint: update to v1.49.0 2022-09-26 11:58:07 +02:00
windows daemon/graphdriver/windows: Remove() don't use defer() in a loop 2022-10-13 23:05:48 +02:00
zfs daemon/graphdriver: use strconv instead of fmt.Sprintf 2023-01-10 10:45:58 +01:00
counter.go graphdriver: Fix RefCounter memory leak 2018-02-09 10:26:06 +08:00
driver.go daemon/graphdriver: remove unused graphdriver.IsInitialized() 2022-04-07 16:21:31 +02:00
driver_freebsd.go Add canonical import comment 2018-02-05 16:51:57 -05:00
driver_linux.go storage-driver: promote overlay2, make Btrfs and ZFS opt-in 2021-07-21 14:53:56 +02:00
driver_test.go fix unclosed file-handles in tests 2022-05-31 21:53:38 +02:00
driver_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
driver_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
errors.go Add canonical import comment 2018-02-05 16:51:57 -05:00
fsdiff.go gofmt GoDoc comments with go1.19 2022-07-13 22:42:29 +02:00
plugin.go Finish refactor of UID/GID usage to a new struct 2022-03-14 16:28:57 -04:00
proxy.go Finish refactor of UID/GID usage to a new struct 2022-03-14 16:28:57 -04:00
proxy_test.go Finish refactor of UID/GID usage to a new struct 2022-03-14 16:28:57 -04:00