When a hardlink to a file is created while tar is processing it, tar
will bail out with 'file has changed as we read it' even if the file did
not in fact change. The attached shell script has a pretty good chance
of demonstrating the bug.

I think the problem is that creating hardlinks updates ctime on the
inode which fools tar into believing that the file has changed. But that
new hardlink does not go into the archive so for all purposes it should
be outside of the what-tar-cares-about domain.

Any ideas how to fix this? I guess you don't want to degrade the ctime
check to a mtime check so to catch changes in permissions etc. Can't
think of some neat way around this right now.

Michal Svoboda

Attachment: tar-bug.sh
Description: Bourne shell script

Reply via email to