From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#13149: 24.3.50; Emacs thinks file was changed outside Emacs, but it was not Date: Mon, 14 Jan 2013 22:45:31 -0800 Organization: UCLA Computer Science Department Message-ID: <50F4FB0B.5070003@cs.ucla.edu> References: <6CDE13E3BCAA4AFAAB8BCE105C6ABF12@us.oracle.com> <874njs19zb.fsf@yandex.ru> <50F3935A.2090003@yandex.ru> <50F41CE7.60306@gmail.com> <50F44E6B.8090007@cs.ucla.edu> <50F484CB.6010905@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1358232401 19029 80.91.229.3 (15 Jan 2013 06:46:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jan 2013 06:46:41 +0000 (UTC) Cc: 13149@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 15 07:46:58 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tv0IT-0004MK-J4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Jan 2013 07:46:57 +0100 Original-Received: from localhost ([::1]:51593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv0IC-0006um-Ru for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Jan 2013 01:46:40 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv0IA-0006uF-2P for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2013 01:46:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tv0I7-0005S8-1p for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2013 01:46:37 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv0I6-0005Rs-TM for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2013 01:46:34 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tv0IY-00023X-3P for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2013 01:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Jan 2013 06:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13149 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: unreproducible moreinfo Original-Received: via spool by 13149-submit@debbugs.gnu.org id=B13149.13582323667820 (code B ref 13149); Tue, 15 Jan 2013 06:47:02 +0000 Original-Received: (at 13149) by debbugs.gnu.org; 15 Jan 2013 06:46:06 +0000 Original-Received: from localhost ([127.0.0.1]:60724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tv0He-000224-9T for submit@debbugs.gnu.org; Tue, 15 Jan 2013 01:46:06 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:40113) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tv0HZ-00021e-Pp for 13149@debbugs.gnu.org; Tue, 15 Jan 2013 01:46:04 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id E51AFA60003; Mon, 14 Jan 2013 22:45:32 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l6cx7Z5h5W8e; Mon, 14 Jan 2013 22:45:32 -0800 (PST) Original-Received: from [192.168.1.9] (pool-71-189-154-249.lsanca.fios.verizon.net [71.189.154.249]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 2AF3839E8100; Mon, 14 Jan 2013 22:45:32 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 In-Reply-To: <50F484CB.6010905@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:69796 Archived-At: On 01/14/2013 02:20 PM, Dmitry Gutov wrote: > stat_mtime=1358201692.000000000 > stat_mtime=1358201692.912737000 That looks like a file system bug, I'm afraid. Does the following work around the bug, if you set the variable sloppy-file-time-stamps? === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-14 17:46:14 +0000 +++ src/ChangeLog 2013-01-15 05:38:42 +0000 @@ -1,3 +1,10 @@ +2013-01-15 Paul Eggert + + Add workaround for file system time stamp bug (Bug#13149). + Reported by Dmitry Gutov for Ubuntu vboxsf mounting MS Windows 7. + * fileio.c (syms_of_fileio) : New variable. + (Fverify_visited_file_modtime): Use it. + 2013-01-14 Paul Eggert Avoid needless casts with XSAVE_POINTER. === modified file 'src/fileio.c' --- src/fileio.c 2013-01-14 17:46:14 +0000 +++ src/fileio.c 2013-01-15 05:38:42 +0000 @@ -5358,7 +5358,17 @@ mtime = (stat (SSDATA (filename), &st) == 0 ? get_stat_mtime (&st) : time_error_value (errno)); - if (EMACS_TIME_EQ (mtime, b->modtime) + + /* On a few buggy file systems, the fractional part of the time stamp, + or perhaps even the low order bit of the seconds part, can + spontaneously change even though the file has not changed. If + SLOPPY_FILE_TIME_STAMPS, work around these bugs at the cost of + possibly missing some changes. */ + if ((EMACS_TIME_EQ (mtime, b->modtime) + || (sloppy_file_time_stamps + && EMACS_TIME_VALID_P (mtime) + && EMACS_TIME_VALID_P (b->modtime) + && EMACS_SECS (mtime) >> 1 == EMACS_SECS (b->modtime) >> 1)) && (b->modtime_size < 0 || st.st_size == b->modtime_size)) return Qt; @@ -6036,6 +6046,13 @@ write_region_inhibit_fsync = 0; #endif + DEFVAR_BOOL ("sloppy-file-time-stamps", sloppy_file_time_stamps, + doc: /* Non-nil means file time stamps are sloppy. +When non-nil, ignore low-order part of time stamp when inferring whether +a file may have changed. Although this suppresses bogus diagnostics +on buggy file systems, it can also lose changes to files. */); + sloppy_file_time_stamps = 0; + DEFVAR_BOOL ("delete-by-moving-to-trash", delete_by_moving_to_trash, doc: /* Specifies whether to use the system's trash can. When non-nil, certain file deletion commands use the function