Skip to content

overlay: use index=off to fix EBUSY on mount - #4311

Merged
fuweid merged 1 commit into
containerd:masterfrom
rudyfly:upsteam_overlay_indexoff
Jun 9, 2020
Merged

fuweid merged 1 commit into
containerd:masterfrom
rudyfly:upsteam_overlay_indexoff

Conversation

@rudyfly

@rudyfly rudyfly commented Jun 8, 2020

Copy link
Copy Markdown
Contributor

kernel version > 4.13rc1 support index=on feature, it will be failed
with EBUSY when trying to mount.

Related: moby/moby#37993

Signed-off-by: Rudy Zhang [email protected]

kernel version > 4.13rc1 support index=on feature, it will be failed
with EBUSY when trying to mount.

Related: moby/moby#37993

Signed-off-by: Rudy Zhang <[email protected]>
@theopenlab-ci

theopenlab-ci Bot commented Jun 8, 2020

Copy link
Copy Markdown

Build succeeded.

@crosbymichael

Copy link
Copy Markdown
Member

LGTM

Thanks!

@Zyqsempai Zyqsempai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@fuweid fuweid left a comment

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.

LGTM

@fuweid
fuweid merged commit 834665d into containerd:master Jun 9, 2020
@dmcgowan

dmcgowan commented Jun 9, 2020

Copy link
Copy Markdown
Member

We avoided porting this functionality over in the past because it was seen as an issue with the design of the Docker drivers, misuse of the snapshot, or a previous failure not being cleaned up. I think it is best to analyze the case that was causing the ebusy in the first place before making a global change like this. This is not the best way to solve the ebusy imo because it means that the snapshot is now mounted twice for write, a condition which can lead to undefined behavior in the overlay upperdir.

@fuweid

fuweid commented Jun 10, 2020

Copy link
Copy Markdown
Member

The root cause is that the snapshotter diff(Compare API) between idA and idB needs to do mount. If one of snapshotters is Active type and mounted for running container, for example it is idA, the upperdir of snapshotter idA will be mounted twice.

We can see that the common case is to commit running container into image. Basically, before committing container, we must pause the container to make sure that Active snapshotter is to be same during pause stage. And snapshotter diff is to read content only. It is safe to use index=off to fix ebusy issue.

This is not the best way to solve the ebusy imo because it means that the snapshot is now mounted twice for write, a condition which can lead to undefined behavior in the overlay upperdir.

I am agree with @dmcgowan . The index=off in overlayfs mount option will hide potential problems and make debugging hard. Maybe we can add index=off in snapshotter diff case only or introduce config option like asyncRemove.

cc @rudyfly


How to reproduce issue?

echo Y > /sys/module/overlay/parameters/index
ctr run -d docker.io/library/busybox:latest testing sleep 1d
ctr snapshot diff testing

@sipsma sipsma mentioned this pull request Dec 10, 2025
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants