chown: use Link instead of Chown for dup inodes#1258
Conversation
drivers/chown_unix.go
Outdated
| // If the dev/inode was already chowned but the file has the original | ||
| // owner then it means the underlying hard link was broken (as it happens with | ||
| // overlay when index=off) so we need to chown again and not rely on the previous | ||
| // chown for the same inode. |
There was a problem hiding this comment.
This comment really confused me - it didn't describe the checks on the next line, and after suggesting that if the checks were true, we still needed to do something, it just returned.
|
Do we want to take the hit of checking inode numbers after the |
|
I suppose if we only checked for "that multiply-linked thing got a new inode number" when |
that is a much better solution. I've played with it and it seems to work fine, I'll test it more and update the PR |
9929743 to
7801d96
Compare
7801d96 to
a7ca09e
Compare
|
LGTM |
|
Are there any tests we can add for this? |
a7ca09e to
5d750d8
Compare
|
LGTM |
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 <gscrivan@redhat.com>
5d750d8 to
35e013a
Compare
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.
#1144 added the initial
check.
Closes: #1257
Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com