Skip to content

[docker-29.x backport] layer: Clean up RW layer if mount metadata save fails#51824

Merged
thaJeztah merged 1 commit intomoby:docker-29.xfrom
thaJeztah:29.x_backport_45939-rw-layer-cleanup
Jan 8, 2026
Merged

[docker-29.x backport] layer: Clean up RW layer if mount metadata save fails#51824
thaJeztah merged 1 commit intomoby:docker-29.xfrom
thaJeztah:29.x_backport_45939-rw-layer-cleanup

Conversation

@thaJeztah
Copy link
Member

Add cleanup for the RW layer directory if saveMount() fails after driver.CreateReadWrite() succeeds. Previously, this failure path would leave an orphaned overlay2 directory with no corresponding metadata.

Related to #45939

(cherry picked from commit d7a6250)

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

Fix potential creation of orphaned overlay2 layers

- A picture of a cute animal (not mandatory but encouraged)

Add cleanup for the RW layer directory if saveMount() fails after
driver.CreateReadWrite() succeeds. Previously, this failure path would
leave an orphaned overlay2 directory with no corresponding metadata.

Related to moby#45939

Signed-off-by: Jan Scheffler <jan.scheffler@qodev.ai>
(cherry picked from commit d7a6250)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the 29.1.4 milestone Jan 8, 2026
@thaJeztah thaJeztah marked this pull request as ready for review January 8, 2026 15:43
@thaJeztah thaJeztah merged commit 8b2c317 into moby:docker-29.x Jan 8, 2026
222 of 223 checks passed
@thaJeztah thaJeztah deleted the 29.x_backport_45939-rw-layer-cleanup branch January 8, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants