[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#13944: closed (file synchronization fixes)

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#13944: closed (file synchronization fixes)
Date: Wed, 13 Mar 2013 18:45:02 +0000

Your message dated Wed, 13 Mar 2013 11:43:17 -0700
with message-id <address@hidden>
and subject line Re: file synchronization fixes
has caused the debbugs.gnu.org bug report #13944,
regarding file synchronization fixes
to be marked as done.

(If you believe you have received this mail in error, please contact

13944: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13944
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: file synchronization fixes Date: Wed, 13 Mar 2013 00:38:00 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4
Tags: patch

The new code for creating regular-file lock files has a problem if
the system crashes while the lock file is being created: due to
races inside the file system, if the crash occurs at the wrong time
the file system may end up with an empty regular-file lock file,
which after the reboot will cause Emacs to bypass locking for that
file indefinitely (unless the empty lock file is removed manually
by the user).

On a POSIX-conforming system the problem can occur only if the
system crashes just as a lock file is being created.  Fixing this
requires using a synchronization primitive such as fsync on the
newly created file, before renaming it.

While looking into this I noticed some other file synchronization
problems.  fsync is used sometimes when fdatasync will do.  Emacs
does not consistently retry fsync after being interrupted.  It
sometimes incorrectly reports an error merely because fsync isn't
supported.  And it sometimes incorrectly skips fsync merely because
we are on a non-BSD system.

Attached a patch which I'd like to install.  If MS-Windows has fdatasync
already this should build on MS-Windows; if not, the MS-Windows port
needs to compile lib/fdatasync.c or support an fdatasync substitute
in some other way.

Attachment: fsync.txt
Description: Text document

--- End Message ---
--- Begin Message --- Subject: Re: file synchronization fixes Date: Wed, 13 Mar 2013 11:43:17 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3
On 03/13/13 11:02, Eli Zaretskii wrote:
> +#define fdatasync _commit

Thanks for the quick review.  I added that line, pushed
it as trunk bzr 112039, and am marking this as done.

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]