Comment 7 for bug 478023

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 478023] [NEW] os.lstat != os.fstat on Windows, possible dirstate caching issue

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> On Sun, 2009-11-08 at 03:46 +0000, John A Meinel wrote:
>>
>> In running the test suite, I found that
>>
>> os.lstat('file')
>> versus
>> os.fstat(open('file', 'rb').fileno())
>>
>> gives slightly different results.
>>
>> Namely, the latter will have a value for 'st.st_ino' while the former
>> will have 0 stored.
>>
>> I haven't investigated, but potentially this is a performance issue
>> for
>> Windows and dirstate. If dirstate ends up caching the result of
>> fstat()
>> but then when iterating we compare that to lstat() we will think the
>> content has changed, and re-read and re-sha the file. If we then
>> stored
>> the value from fstat() again, we would have done all that work and
>> then
>> store bogus data again.
>>
>> I don't think we are being that bad, or we would have noticed earlier.
>> But it is something we should be careful about trusting fstat versus
>> lstat, and I haven't had a chance to audit the code.
>
> Cygwin or win32?
>
> -Rob
>

win32

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksBgM0ACgkQJdeBCYSNAANXHgCbBumkN/q1hg3+6u2syfZqMyC0
18IAn1ZKG8AUgxsWZO3zQyUpjLSDMIw4
=8kBk
-----END PGP SIGNATURE-----