Subject: bug#13149: 24.3.50; Emacs thinks file was changed outside Emacs, but it was not

From: Dmitry Gutov <[email-masked]>
Date: Tue, 15 Jan 2013 02:20:59 +0400

On 14.01.2013 22:28, Paul Eggert wrote:
> I'd guess it's a filesystem problem, where a file's
> timestamp spontaneously changes even though the file
> itself has not changed.  I had thought those bugs
> fixed long ago, but maybe not.

My uninformed guess was there's a delay when writing to the file, and so 
the mtime is slightly later than the time Emacs saved.

> Could you please start by trying the attached patch,
> and then see what gets sent to stderr around the time
> of the problem?  That might help us work around the
> problem better than the old code did (it introduced
> some race conditions).

Here you go, the stderr output during (open, modify, save, try to 
modify, y, modify, try to save, yes):

stat_mtime=1358175175.428731700
stat_mtime=1358175175.428731700
stat_mtime=1358175175.428731700
stat_mtime=1358175175.428731700
stat_mtime=1358175175.428731700
stat_mtime=1358175175.428731700
stat_mtime=1358175175.428731700
stat_mtime=1358175175.428731700
stat_mtime=1358175175.428731700
stat_mtime=1358175175.428731700
stat_mtime=1358201692.000000000
stat_mtime=1358201692.912737000
stat_mtime=1358201692.912737000
stat_mtime=1358194311.328310000
stat_mtime=1358194758.218531401
stat_mtime=1358201692.912737000
stat_mtime=1358201692.912737000
stat_mtime=1358201692.912737000
stat_mtime=1358201692.912737000
stat_mtime=1358201692.912737000
stat_mtime=1358201692.912737000
stat_mtime=1358201706.000000000
stat_mtime=1358201706.392448700

Suspicious zeros?