Files
moby/daemon
Jan Scheffler 70004549fb layer: Fix orphan creation in registerWithDescriptor
Start the metadata transaction before creating the overlay2 directory.
This ensures that if driver.Create() fails, we can properly cancel the
transaction. Previously, if StartTransaction() failed after driver.Create()
succeeded, the defer cleanup would not run (not registered yet), leaving
an orphaned overlay2 directory.

The fix reorders operations so that:
1. Transaction is started first (no filesystem changes yet)
2. Overlay2 directory is created second (transaction ready for cleanup)
3. Defer is registered after both succeed (tx is guaranteed non-nil)

If driver.Create() fails, the transaction is explicitly cancelled before
returning. The nil check for tx in the defer is no longer needed since
tx is guaranteed to exist when the defer runs.

Related to moby/moby#45939

Signed-off-by: Jan Scheffler <jan.scheffler@qodev.ai>
2025-12-12 09:44:04 +00:00
..
2025-10-27 12:39:21 +01:00
2025-07-31 10:13:29 -07:00
2025-05-30 15:59:13 +02:00
2025-10-31 17:00:33 +09:00
2025-05-30 15:59:13 +02:00
2025-07-31 10:13:29 -07:00
2025-10-30 19:41:58 +01:00
2025-11-05 15:48:02 +01:00
2025-08-01 01:48:55 +02:00