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


Le 08/01/2011 04:13, Larry Hall (Cygwin) a Ãcrit :
> 
> On 1/7/2011 9:39 PM, Steven Hartland wrote:
> 
> <snip>
> 
>> Here it takes about 2 - 5mins for what ever is causing the 0 size after a
>> find to start to happen. Prior to that after the find all dirs show
>> 8192 for
>> size in an ls.
> 
> Ah, that's interesting.  I see no such time-lag here.
> 
<snip>
it seems to depend on the number of the entries the directory has.

Cyrille@nowhere ~/somewhere/cvs
v2$ ls -ld
drwxrwsr-x+ 1 Cyrille         None       0 Feb 15  2007 .

Cyrille@nowhere ~/somewhere/cvs
v2$ ll
total 128
drwxrwsr-x+ 1 Cyrille None 8192 Sep 10 20:00 CVSROOT
drwxrwsr-x+ 1 Cyrille None 4096 Jun 18  2010 exploitation
drwxrwsr-x+ 1 Cyrille None    0 Oct 12  2006 test

Cyrille@nowhere ~/somewhere/cvs
v2$ for i in 1 2 3 4 5 6 7 8 9 0; do for j in 1 2 3 4 5 6 7 8 9 0; do
echo $i$j; done; done | xargs mkdir

Cyrille@nowhere ~/somewhere/cvs
v2$ ls -ld
drwxrwsr-x+ 1 Cyrille None 16384 Jan  8 15:02 .

Cyrille@nowhere ~/somewhere/cvs
v2$ for i in 1 2 3 4 5 6 7 8 9 0; do for j in 1 2 3 4 5 6 7 8 9 0; do
echo $i$j; done; done | xargs rmdir

Cyrille@nowhere ~/somewhere/cvs
v2$ ls -ld
drwxrwsr-x+ 1 Cyrille None 16384 Jan  8 15:03 .

reboot

Cyrille@nowhere ~/somewhere/cvs
$ ls -ld
drwxrwsr-x+ 1 Cyrille None 0 Jan  8 15:03 .

Cyrille@nowhere ~/somewhere/cvs
$ find . > /dev/null

Cyrille@nowhere ~/somewhere/cvs
$ ls -ld
drwxrwsr-x+ 1 Cyrille None 16384 Jan  8 15:03 .

IMHO, the first time the directory size is read, the size used by
FindFirstFile/FindNextFile (or something like that :-) is zero'ed,
then the directory size is updated while the directory is traversed.
also the directory size doesn't seem to shrink on entry removal,
even after a reboot.

Regards,

Cyrille Lefevre
-- 
mailto:Cyrille.Lefevre-lists@laposte.net




--
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]