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

Hard-linked files cannot be read and the link counts aren't correct. #20

Closed
ktock opened this issue Oct 6, 2019 · 0 comments · Fixed by #21
Closed

Hard-linked files cannot be read and the link counts aren't correct. #20

ktock opened this issue Oct 6, 2019 · 0 comments · Fixed by #21

Comments

@ktock
Copy link
Contributor

ktock commented Oct 6, 2019

Issue description

Currently we can't deal with hard-link.

Issue Reproduction

In the tar file of ubuntu:18.04 base layer(sha256:6958ba61ef42a87f438b918c94a12af7a64a415a23dbed8e364eb6af9bb0845a), there is a hardlink:

 hrwxr-xr-x       0/0             0 bin/uncompress ==> bin/gunzip

We can get the original file on CRFS:

$ cat /crfs/layers/gcr.io/reasonablek8s/ubuntu/18.04/0/bin/gunzip
#!/bin/sh
# Uncompress files.  This is the inverse of gzip.

# Copyright (C) 2007 Free Software Foundation
...

But the link counts aren't correct.

$ stat --print="%h\n" /crfs/layers/gcr.io/reasonablek8s/ubuntu/18.04/0/bin/gunzip
1
$ stat --print="%h\n" /crfs/layers/gcr.io/reasonablek8s/ubuntu/18.04/0/bin/uncompress
1

And we get an empty file from the hardlink.

$ file /crfs/layers/gcr.io/reasonablek8s/ubuntu/18.04/0/bin/uncompress
/crfs/layers/gcr.io/reasonablek8s/ubuntu/18.04/0/bin/uncompress: empty

Additionally, when we cat it, we get EIO.

The cause of issue

There are two causes:

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 a pull request may close this issue.

1 participant