Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store: fix graphLock reload #926

Merged
merged 3 commits into from
May 27, 2021

Conversation

giuseppe
Copy link
Member

use s.graphLock.Modified() instead of s.graphLock.TouchedSince().

TouchedSince() seems to fail in some cases when comparing the inode mtime with the current time.

Avoid such kind of problems in a critical code path as store.mount(), as we must be sure there is already a driver home mount present, otherwise it the next process may cover the container mount with the home mount.

Closes: containers/podman#10454

Signed-off-by: Giuseppe Scrivano [email protected]

giuseppe added 3 commits May 27, 2021 14:51
it solves a problem where s.getGraphDriver() was accessed without
holding a lock on s.graphLock as it is expected.

Signed-off-by: Giuseppe Scrivano <[email protected]>
use s.graphLock.Modified() instead of s.graphLock.TouchedSince().

TouchedSince() seems to fail in some cases when comparing the inode
mtime with the current time.

Avoid such kind of problems in a critical code path as store.mount(),
as we must be sure there is already a driver home mount present,
otherwise it the next process may cover the container mount with the
home mount.

Closes: containers/podman#10454

Signed-off-by: Giuseppe Scrivano <[email protected]>
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@rhatdan rhatdan left a comment

Choose a reason for hiding this comment

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

LGTM

@rhatdan rhatdan merged commit 5477b99 into containers:master May 27, 2021
@edsantiago
Copy link
Member

Followup: I applied this as a patch to my podman tree this morning, built, started a reproducer. Just got back home, 298 iterations, no failures. LGTM. Thank you @giuseppe .

mtrmac added a commit to mtrmac/storage that referenced this pull request Nov 22, 2022
At least containers#926 suggests that
using timestamps "seems to fail", without elaborating further.

At the very least, ModifiedSince is the more general check, because it
can work across shared filesystems or on filesystems with bad timestamp
granularity, it's about as costly (a single syscall, pread vs. fstat),
and we can now completely eliminate tracking store.lastLoaded.

The more common code shape will also help factor the common code out further.

Signed-off-by: Miloslav Trmač <[email protected]>
mtrmac added a commit to mtrmac/storage that referenced this pull request Dec 1, 2022
At least containers#926 suggests that
using timestamps "seems to fail", without elaborating further.

At the very least, ModifiedSince is the more general check, because it
can work across shared filesystems or on filesystems with bad timestamp
granularity, it's about as costly (a single syscall, pread vs. fstat),
and we can now completely eliminate tracking store.lastLoaded.

The more common code shape will also help factor the common code out further.

Signed-off-by: Miloslav Trmač <[email protected]>
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.

podman rm, with more than one arg: error removing container, unlinkat, EBUSY
4 participants