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

drivers, chown: support chown of hard links #1144

Merged
merged 2 commits into from
Feb 21, 2022

Conversation

giuseppe
Copy link
Member

make sure the same inode is not chowned twice. Track all the inodes that are chowned and skip the same inode if it is encountered multiple times.

Closes: #1143

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

it is a preparatory commit.

Signed-off-by: Giuseppe Scrivano <[email protected]>
make sure the same inode is not chowned twice.  Track all the inodes
that are chowned and skip the same inode if it is encountered multiple
times.

Closes: containers#1143

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe giuseppe force-pushed the chown-skip-hard-links branch from ab2089b to f59aa7a Compare February 21, 2022 14:35
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
Copy link
Member

rhatdan commented Feb 21, 2022

@nalind
Copy link
Member

nalind commented Feb 21, 2022

LGTM

@rhatdan rhatdan merged commit 765d5b3 into containers:main Feb 21, 2022
giuseppe added a commit to giuseppe/storage that referenced this pull request Jun 13, 2022
Add an additional check before deciding whether the chown must be
skipped.  If the underlying storage (as it could be overlay with
index=off) breaks the hard link on copy up then we cannot skip the
chown even if the dev/ino was already encountered.

containers#1144 added the initial
check.

Closes: containers#1257

Signed-off-by: Giuseppe Scrivano <[email protected]>
giuseppe added a commit to giuseppe/storage that referenced this pull request Jun 13, 2022
If the inode was already encountered and chowned, use link(2) instead
of chown(2).

This is needed when the underlying storage (as it could be overlay
with index=off) breaks the hard link on copy up.

containers#1144 added the initial
check.

Closes: containers#1257

Signed-off-by: Giuseppe Scrivano <[email protected]>
giuseppe added a commit to giuseppe/storage that referenced this pull request Jun 14, 2022
If the inode was already encountered and chowned, use link(2) instead
of chown(2).

This is needed when the underlying storage (as it could be overlay
with index=off) breaks the hard link on copy up.

containers#1144 added the initial
check.

Closes: containers#1257

Signed-off-by: Giuseppe Scrivano <[email protected]>
giuseppe added a commit to giuseppe/storage that referenced this pull request Jun 14, 2022
If the inode was already encountered and chowned, use link(2) instead
of chown(2).

This is needed when the underlying storage (as it could be overlay
with index=off) breaks the hard link on copy up.

containers#1144 added the initial
check.

Closes: containers#1257

Signed-off-by: Giuseppe Scrivano <[email protected]>
giuseppe added a commit to giuseppe/storage that referenced this pull request Jun 14, 2022
If the inode was already encountered and chowned, use link(2) instead
of chown(2).

This is needed when the underlying storage (as it could be overlay
with index=off) breaks the hard link on copy up.

containers#1144 added the initial
check.

Closes: containers#1257

Signed-off-by: Giuseppe Scrivano <[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 run with --uidmap options randomly causes Host ID ${HOSTID} cannot be mapped to a container ID error
3 participants