-
Notifications
You must be signed in to change notification settings - Fork 801
layer: add hardlink handling information #336
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
Conversation
layer.md
Outdated
| Non-directory files with linkcount greater than 1 have hardlinks. | ||
| The corresponding files that share the link with the > 1 linkcount may be outside the directory that the changeset is being produced from, in which case the `linkname` is not recorded in the changeset. | ||
|
|
||
| Hardlinks are stored in a tar archive with type of `'1'`, per the [Basic Tar Format][tar-standard]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linking to the GNU docs makes it less clear where this fits in the basket of tar standards ;). libarchive's tar(5) attributes this typeflag to ustar (IEEE Std 1003.1-1988). IEEE Std 1003.1-1988 has been superseded by IEEE Std 1003.1-2008, which seems to have been superseded by IEEE Std 9945-2009. The IEEE versions are paywalled, so I'm not sure what's inside. But it's probably better to mention ustar and successors here, and possibly link to the libarchive man page for more historical context, instead of linking to the GNU docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You drop so many links and words, but they still resolve to the same thing, that the typeflag is '1'
philips
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@vbatts this upset the pdf build somehow |
layer.md
Outdated
| Not all filesystems support hardlinks (e.g. [FAT](https://en.wikipedia.org/wiki/File_Allocation_Table)). | ||
|
|
||
| Hardlinks are possible with all [file types](#file-types) except `directories`. | ||
| Non-directory files with linkcount greater than 1 have hardlinks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to clarify that these must also have the same inode and devid. It looks something like https://github.com/stevvooe/continuity/blob/master/hardlinks_unix.go#L11 in practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I got at that in the pseudocode, but should put it in a sentence here too
|
|
||
| #### Hardlinks | ||
|
|
||
| Hardlinks are a [POSIX concept](http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html) for having one or more directory entries for the same file on the same device. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stevvooe i do say part of that here. So, make it more explicit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vbatts I still think that condition needs to be added to the clause above. The issue is that two files with the same inode but different devices ids are two separate hardlinks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Thu, Sep 22, 2016 at 02:14:30PM -0700, Stephen Day wrote:
@vbatts I still think that condition needs to be added to the clause
above. The issue is that two files with the same inode but different
devices ids are two separate hardlinks.
He covers that in Markdown in the next paragraph. Are you just asking for “file” → “inode” here?
|
On Thu, Sep 22, 2016 at 12:32:47PM -0700, Vincent Batts wrote:
And the tar flavor must be ustar-compatible. If we depend on a BEWARE BEWARE BEWARE that the following information is still above some newer structures. And it also has (at the very bottom): For references, see ISO/IEC 9945-1:1990 or IEEE Std 1003.1-1990, So I think we should take that advice and reference one of those |
4daaa1d to
2be6ecf
Compare
|
updated. PTAL. |
layer.md
Outdated
|
|
||
| Hardlinks are possible with all [file types](#file-types) except `directories`. | ||
| Non-directory files have hardlinks when the linkcount is greater than 1. | ||
| Hardlinked files are on a same device (i.e. comparing Major:Minor pair), and have the same inode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: No need for the comma here; “hardlinked files” is the subject of both portions.
layer.md
Outdated
| Hardlinked files are on a same device (i.e. comparing Major:Minor pair), and have the same inode. | ||
| The corresponding files that share the link with the > 1 linkcount may be outside the directory that the changeset is being produced from, in which case the `linkname` is not recorded in the changeset. | ||
|
|
||
| Hardlinks are stored in a tar archive with type of '`1`', per the [GNU Basic Tar Format][gnu-tar-standard] and [libarchive(5)][libarchive]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Quoting and backticking seems strange. Can we just backtick or just quote?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the page you are linking is libarchive's tar(5), not libarchive(5). I think you want a line like:
Hardlinks are stored in a tar archive with type of `1` as specified by [IEEE Std 1003.1-1988][ieee1003.1-1998] (“ustar”, discussed [here][gnu-tar-standard] and [here][tar.5-ustar]).
[ieee1003-1998]: http://standards.ieee.org/findstds/standard/1003.1-1988.html
[gnu-tar-standard]: http://www.gnu.org/software/tar/manual/html_node/Standard.html
[tar.5-ustar]: https://github.com/libarchive/libarchive/wiki/ManPageTar5#POSIX_ustar_Archives
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like you said that is paywalled. I'm not going to use that reference for now. The other docs include their own citing.
2be6ecf to
f91b794
Compare
|
updated. PTAL |
|
On Fri, Sep 23, 2016 at 11:33:05AM -0700, Vincent Batts wrote:
The other docs cite many references, and I'm not sure which one we're |
|
If we want a freely-accessible standard, I'd suggest pax (IEEE Std |
|
On 23/09/16 12:00 -0700, W. Trevor King wrote:
Really, what are you trying to accomplish with responses like this? |
|
On Fri, Sep 23, 2016 at 12:37:53PM -0700, Vincent Batts wrote:
The idea with a spec like this is to define behavior so that different If we require support for the pax format as defined by IEEE Std If we explicitly make the tar version unspecified or But by doing neither of those, layer interop is just confusing. |
layer.md
Outdated
| Not all filesystems support hardlinks (e.g. [FAT](https://en.wikipedia.org/wiki/File_Allocation_Table)). | ||
|
|
||
| Hardlinks are possible with all [file types](#file-types) except `directories`. | ||
| Non-directory files have hardlinks when the linkcount is greater than 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-directory files are considered "hardlinked" when their link count is greater than 1.
|
@vbatts I read it through again it looks good. |
Fixes: opencontainers#306 Signed-off-by: Vincent Batts <[email protected]>
f91b794 to
8cd0673
Compare
|
updated. On Fri, Sep 23, 2016 at 6:53 PM, Stephen Day [email protected]
|
Fixes: #306
/cc @stevvooe @philips
Signed-off-by: Vincent Batts [email protected]