From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#13149: 24.3.50; Emacs thinks file was changed outside Emacs, but it was not Date: Tue, 15 Jan 2013 12:54:03 +0400 Message-ID: <50F5192B.602@yandex.ru> 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> <50F4FB0B.5070003@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1358240080 15527 80.91.229.3 (15 Jan 2013 08:54:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jan 2013 08:54:40 +0000 (UTC) Cc: 13149@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 15 09:54: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 1Tv2IL-0001IR-L4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Jan 2013 09:54:57 +0100 Original-Received: from localhost ([::1]:48750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv2I5-0003jn-B6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Jan 2013 03:54:41 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv2I0-0003jP-PA for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2013 03:54:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tv2Hy-0008Ak-3u for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2013 03:54:36 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv2Hy-0008Af-0C for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2013 03:54:34 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tv2IP-00052V-QE for bug-gnu-emacs@gnu.org; Tue, 15 Jan 2013 03:55:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Jan 2013 08:55:01 +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.135824008019343 (code B ref 13149); Tue, 15 Jan 2013 08:55:01 +0000 Original-Received: (at 13149) by debbugs.gnu.org; 15 Jan 2013 08:54:40 +0000 Original-Received: from localhost ([127.0.0.1]:60864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tv2I3-00051v-FJ for submit@debbugs.gnu.org; Tue, 15 Jan 2013 03:54:39 -0500 Original-Received: from mail-la0-f44.google.com ([209.85.215.44]:56088) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tv2I0-00051k-HO for 13149@debbugs.gnu.org; Tue, 15 Jan 2013 03:54:37 -0500 Original-Received: by mail-la0-f44.google.com with SMTP id fr10so4829321lab.31 for <13149@debbugs.gnu.org>; Tue, 15 Jan 2013 00:54:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=l7+GtFUr7ulRk3VfjYX+rL89f9r0cfd8RLEoGJMu6DE=; b=N7660gtAyts5S6WwgADh4ovAx4KNo48rB8frSQ72Kesq79uqRnMas4OZqn3wIiQINo Wuyq6vvESLsNLpWI6ssVlYq8luD3nevCinxBOjRNi5B/lyak4raEjb1PjSqGpYI+KfEe VqHRJOLI60sJGmNIXlEk/YJ5wN5k89cqUiCU3sM95X+65Zz7ms7p5G8NfUYNMoPsM0ci EbKTYtzp1VpSsuG61sTQO3gG9T0+IS94YORDuJnBlyz/t0RFL+Ew1hVhMkGuKcaDpwDl AzpPLvUhvsKQtfrfuq0+JxRyj51Qo71mu3HKMGMy8XJd345m4q0+HZrc382WeqQcVgwl +7pg== X-Received: by 10.152.123.49 with SMTP id lx17mr32916924lab.52.1358240046733; Tue, 15 Jan 2013 00:54:06 -0800 (PST) Original-Received: from [127.0.0.1] ([178.252.98.87]) by mx.google.com with ESMTPS id o2sm2519454lby.11.2013.01.15.00.54.04 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jan 2013 00:54:05 -0800 (PST) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 In-Reply-To: <50F4FB0B.5070003@cs.ucla.edu> 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:69797 Archived-At: On 15.01.2013 10:45, Paul Eggert wrote: > 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? Not entirely. When the value is t, it works ok right after I open the file, and also if I wait a second or more between save buffer commands. If I repeat modify -> save cycle quickly enough, the problem is still visible. > === 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 > >