all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Bertrand Brelier <bertrand.brelier@gmail.com>
Cc: 19607@debbugs.gnu.org, Jakob Unterwurzacher <jakobunt@gmail.com>
Subject: bug#19607: issue with Emacs 24.4.1 but not with 24.3.1 : changed on disk; really edit the buffer
Date: Tue, 27 Jan 2015 14:29:57 -0800	[thread overview]
Message-ID: <54C81165.2060206@cs.ucla.edu> (raw)
In-Reply-To: <CADF9Jrg6MRRBJrjndyCuL7JLAkkhTKU47h5g4S5EnM4G30wKEA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 701 bytes --]

I see from Jakob's email that the bug can be reproduced on CIFS without 
EncFS.  However, there's still something wrong here, as Emacs has code 
to work around the CIFS bug; see the comment about CIFS in 
emacs/src/fileio.c starting at line 4897, here:

http://git.savannah.gnu.org/cgit/emacs.git/tree/src/fileio.c?id=a56eab8259568ea1389e972623e46359e73c0233#n4897

Unfortunately, this workaround for the CIFS bug does not appear to 
suffice for EncFS over CIFS.

Bertrand, can you please try the attached program, both on plain CIFS 
and on EncFS over CIFS?  It attempts to mimic Emacs's actions more 
precisely than the previous test program, which may help us to narrow 
down the problem.  Thanks.

[-- Attachment #2: test.c --]
[-- Type: text/plain, Size: 1311 bytes --]

#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>

int
main (void)
{
  char const *filename = "test.txt";
  int fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666);
  if (fd < 0)
    return perror ("open"), 1;
  static char const message[] = "This is a test.\n";
  int messagelen = sizeof message - 1;
  if (write (fd, message, messagelen) != messagelen)
    return perror ("write"), 1;
  if (fsync (fd) != 0)
    return perror ("fsync"), 1;
  struct stat st1, st2, st3;
  if (fstat (fd, &st1) != 0)
    return perror ("fstat"), 1;
  if (close (fd) != 0)
    return perror ("close"), 1;
  int fd2 = open(filename, O_WRONLY|O_CLOEXEC);
  if (fd2 < 0)
    return perror ("open 2"), 1;
  if (fstat (fd2, &st2) != 0)
    return perror ("fstat 2"), 1;
  if (close (fd2) != 0)
    return perror ("close 2"), 1;
  if (! (st1.st_mtim.tv_sec == st2.st_mtim.tv_sec
	 && st1.st_mtim.tv_nsec == st2.st_mtim.tv_nsec))
    printf ("Emacs should work around this POSIX-conformance bug.\n");
  sleep (2);
  if (stat (filename, &st3) != 0)
    return perror ("stat"), 1;
  if (! (st2.st_mtim.tv_sec == st3.st_mtim.tv_sec
	 && st2.st_mtim.tv_nsec == st3.st_mtim.tv_nsec))
    {
      printf ("Emacs does not work around this POSIX-conformance bug.\n");
      return 1;
    }
  return 0;
}

  parent reply	other threads:[~2015-01-27 22:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15 13:23 bug#19607: issue with Emacs 24.4.1 but not with 24.3.1 : changed on disk; really edit the buffer Bertrand Brelier
2015-01-20  9:39 ` Paul Eggert
2015-01-20 13:19   ` Bertrand Brelier
2015-01-21  0:21     ` Paul Eggert
2015-01-21 13:12       ` Bertrand Brelier
2015-01-22  2:20         ` Paul Eggert
2015-01-22 14:16           ` Bertrand Brelier
2015-01-22 20:55             ` Paul Eggert
2015-01-22 21:26               ` Bertrand Brelier
2015-01-22 22:42                 ` Paul Eggert
2015-01-23 13:15                   ` Bertrand Brelier
2015-01-23 22:27                     ` Paul Eggert
2015-01-26 13:08                       ` Bertrand Brelier
2015-01-26 19:43                         ` Paul Eggert
2015-01-27 22:29                         ` Paul Eggert [this message]
2015-01-27 23:04                           ` Jakob Unterwurzacher
2015-01-28  4:56                             ` Paul Eggert
2015-03-23 18:58                               ` Glenn Morris
2015-03-24  0:13                                 ` Paul Eggert
2015-01-28 13:11                           ` Bertrand Brelier
2015-01-26 23:08 ` Jakob Unterwurzacher
2015-01-27 21:30 ` bug#19607: issue with Emacs 24.4.1 but not with 24.3.1 : changed on disk; Jakob Unterwurzacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54C81165.2060206@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=19607@debbugs.gnu.org \
    --cc=bertrand.brelier@gmail.com \
    --cc=jakobunt@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.