This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Strange fstatat / stat behavour on directories causing tar "file changed as we read it" error


On Jan 12 16:20, Corinna Vinschen wrote:
> On Jan 12 08:01, Eric Blake wrote:
> > then cygwin's behavior DOES matter to tar - no other system changes the
> > st_size of a directory without ALSO adding or deleting files within that
> > directory and also updating the st_mtim of the directory; at which point
> > tar is entirely within its rights to complain (the directory changed
> > while trying to read it, so the tar file may be incomplete).  Locking
> > st_size at 0 avoids the issue entirely, whether or not upstream tar
> > agrees that checking changes in st_mtim but ignoring changes in st_size
> > would be a more appropriate behavior.
> 
> The fact that a directory change will also change st_mtime is a good
> point.  That's obviously not the case in the observed scenario.
> However, a call to touch could have done that.  But I see the point.
> st_ctime is a more reliable candidate for this kind of test and it
> will also not be changed.

I've checked in a patch with sets st_size to 0 for all directories,
except on NFS, which hopefully isn't affected by this problem.


However, there's still the question I already asked yesterday.
Can somebody who can reproduce the issue test this?


I'm missing the information if the allocation size is affected as well.
You can see that when using stat(1).

For a directory which changes size in one of the observed scenarios,
what does stat print?  Does it look like this:

  $ stat weird_dir | grep Size
  Size: 0               Blocks: 0          IO Block: 65536  directory
  $ stat weird_dir | grep Size
  Size: 4096            Blocks: 4          IO Block: 65536  directory

or does it look like this:

  $ stat weird_dir | grep Size
  Size: 0               Blocks: 4          IO Block: 65536  directory
  $ stat weird_dir | grep Size
  Size: 4096            Blocks: 4          IO Block: 65536  directory

?


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]