Skip to content

rootless: overlay2: fix "createDirWithOverlayOpaque(...) ... input/output error"#42188

Merged
tiborvass merged 3 commits intomoby:masterfrom
AkihiroSuda:fix-overlay2-naivediff
Apr 1, 2021
Merged

rootless: overlay2: fix "createDirWithOverlayOpaque(...) ... input/output error"#42188
tiborvass merged 3 commits intomoby:masterfrom
AkihiroSuda:fix-overlay2-naivediff

Conversation

@AkihiroSuda
Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda commented Mar 23, 2021

- What I did
Fix createDirWithOverlayOpaque(...) ... input/output error on rootless.

Fix docker/for-linux#1055 (intermittent error, on Debian 10, kernel < 5.11)
Fix #42177 (100% reproducible error, on kernel >= 5.11)
Fix #42206

- How I did it

[bug fix] Commit 1: overlay2: call d.naiveDiff.ApplyDiff when useNaiveDiff==true

Previously, d.naiveDiff.ApplyDiff was not used even when useNaiveDiff()==true

[optimization] Commit 2: overlay2: doesSupportNativeDiff: add fast path for userns

When running in userns, returns error (i.e. "use naive, not native") immediately.

No substantial change to the logic.

[clean up] Commit 3: archive: do not use overlayWhiteoutConverter for UserNS

overlay2 no longer sets archive.OverlayWhiteoutFormat when running in UserNS, so we can remove the complicated logic in the archive package.

- How to verify it

$ docker --context=rootless pull python:3.9

- Description for the changelog

rootless: overlay2: fix "createDirWithOverlayOpaque(...) ... input/output error"

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

🐧

Comment thread daemon/graphdriver/overlay2/overlay.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, nice find; I did a quick check if we accidentally (or intentionally) removed this, but looks like it was missed when this function was added in 64b43ed (#28138); all other functions had the check added, except for this one 😲 😂

Comment thread pkg/archive/archive_linux.go Outdated
Previously, `d.naiveDiff.ApplyDiff` was not used even when
`useNaiveDiff()==true`

Signed-off-by: Akihiro Suda <[email protected]>
Comment thread daemon/graphdriver/overlay2/check.go Outdated
Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

When running in userns, returns error (i.e. "use naive, not native")
immediately.

No substantial change to the logic.

Signed-off-by: Akihiro Suda <[email protected]>
overlay2 no longer sets `archive.OverlayWhiteoutFormat` when
running in UserNS, so we can remove the complicated logic in the
archive package.

Signed-off-by: Akihiro Suda <[email protected]>
@AkihiroSuda AkihiroSuda force-pushed the fix-overlay2-naivediff branch from 7bb213d to 6322dfc Compare March 29, 2021 05:47
@AkihiroSuda AkihiroSuda requested a review from thaJeztah March 30, 2021 09:06
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I want to have a look at #42188 (comment) after this is merged; I have a feeling we are loading the driver in situations where we shouldn't (so possible could skip the driver as a whole on initialization, but have to continue following the code paths)

@AkihiroSuda
Copy link
Copy Markdown
Member Author

Two LGTMs, can we merge?

@tiborvass
Copy link
Copy Markdown
Contributor

tiborvass commented Apr 1, 2021

@AkihiroSuda sure we can merge but can you please change the Changelog line to something that encompasses (or enumerates) the user-facing fixes it provides? Something I can copy/paste that doesn't explain internal source code changes.

@tiborvass
Copy link
Copy Markdown
Contributor

@AkihiroSuda rootless: Fix "createDirWithOverlayOpaque(...) ... input/output" errors ?

@AkihiroSuda
Copy link
Copy Markdown
Member Author

Changed to rootless: overlay2: fix "createDirWithOverlayOpaque(...) ... input/output error", PTAL

@AkihiroSuda AkihiroSuda changed the title overlay2: call d.naiveDiff.ApplyDiff when useNaiveDiff==true (fix "createDirWithOverlayOpaque(...) ... input/output error" on rootless) rootless: overlay2: fix "createDirWithOverlayOpaque(...) ... input/output error" Apr 1, 2021
@tiborvass
Copy link
Copy Markdown
Contributor

Is it fair to assume that the following failure is unrelated?

[2021-04-01T10:07:28.422Z] --- FAIL: TestDaemonHostGatewayIP (1.82s)
[2021-04-01T10:07:28.422Z]     daemon_linux_test.go:144: [d33ce54e38604] failed to start daemon with arguments [--data-root /go/src/github.com/docker/docker/bundles/test-integration/TestDaemonHostGatewayIP/d33ce54e38604/root --exec-root /tmp/dxr/d33ce54e38604 --pidfile /go/src/github.com/docker/docker/bundles/test-integration/TestDaemonHostGatewayIP/d33ce54e38604/docker.pid --userland-proxy=true --containerd-namespace d33ce54e38604 --containerd-plugins-namespace d33ce54e38604p --containerd /var/run/docker/containerd/containerd.sock --host unix:///tmp/docker-integration/d33ce54e38604.sock --debug --storage-driver overlay2] : [d33ce54e38604] daemon exited during startup: exit status 1

@tiborvass
Copy link
Copy Markdown
Contributor

From the daemon logs:

failed to start daemon: Error initializing network controller: Error creating default "bridge" network: Failed to Setup IP tables: Unable to enable SKIP DNAT rule:  (iptables failed: iptables --wait -t nat -I DOCKER -i docker0 -j RETURN: iptables: No chain/target/match by that name.
 (exit status 1))

this does look unrelated.

@tiborvass tiborvass merged commit 5b11047 into moby:master Apr 1, 2021
@tiborvass
Copy link
Copy Markdown
Contributor

@AkihiroSuda feel free to backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

4 participants