[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] Bug? Where? Why? Why so many files changing as we read the
From: |
Pavel Raiskup |
Subject: |
Re: [Bug-tar] Bug? Where? Why? Why so many files changing as we read them? |
Date: |
Tue, 27 Oct 2015 09:06:18 +0100 |
User-agent: |
KMail/4.14.10 (Linux/4.2.3-300.fc23.x86_64; KDE/4.14.11; x86_64; ; ) |
On Monday 26 of October 2015 14:30:14 Linda A. Walsh wrote:
> > Try 'stat' on this file before/after running 'tar -c'. See '10.1.3 Race
> > conditions' section in documentation [1].
> ----
> Well the 78 messages come out sprinkled throughout a 60-70K file dump.
> It doesn't seem a 'stat' would be practical to try to isolate 1 in 1000
> files for a change that "might" be occurring...
One file is enough to prove that the "at least one file" has really
changed and tar is most likely not guilty, src/create.c source:
if ((timespec_cmp (get_stat_ctime (&final_stat), original_ctime) != 0
/* Original ctime will change if the file is a directory and
--remove-files is given */
&& !(remove_files_option && is_dir))
|| original_size < final_stat.st_size)
{
WARNOPT (WARN_FILE_CHANGED,
(0, 0, _("%s: file changed as we read it"),
quotearg_colon (p)));
set_exit_status (TAREXIT_DIFFERS);
}
So in case the "guilty" file has not changed its 'ctime' or its size, tar
should not complain. If there is a bug in GNU tar, I would suggest you to
use debugger and walk precisely through the cited code.