GNU bug report logs - #72641
31.0.50; "Unlocking file: Invalid argument" when deleting lock file on network file system

Previous Next

Package: emacs;

Reported by: Michal Nazarewicz <mina86 <at> mina86.com>

Date: Thu, 15 Aug 2024 16:03:02 UTC

Severity: normal

Merged with 70973

Found in versions 29.1, 31.0.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Michal Nazarewicz <mina86 <at> mina86.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 72641 <at> debbugs.gnu.org
Subject: bug#72641: 31.0.50; "Unlocking file: Invalid argument" when deleting lock file on network file system
Date: Thu, 15 Aug 2024 14:43:21 -0700
[Message part 1 (text/plain, inline)]
On 2024-08-15 10:44, Michal Nazarewicz wrote:
> The*Warnings* buffer constantly popping up is annoying so I’d love this
> to be addressed though to be honest I’m not sure what would be a good
> solution.  Though I guess you can also argue this is CIFS bug.

It's definitely a file system bug. The symlink syscall should never 
create a regular file. I suggest reporting the bug to whoever maintains 
your file system code.

I don't see any good way to prevent Emacs from creating these 
zero-length files on buggy file systems.

That being said, I think Emacs can ignore and remove bad lock files 
without introducing more races. I installed the attached into the master 
branch and it works for me on your test case (which I introduced 
artificially on GNU/Linux). Please give it a try.

The first patches in this series are just setup. The last patch is the 
real workaround.
[0001-Fix-unlikely-lock-file-integer-overflow.patch (text/x-patch, attachment)]
[0002-Avoid-some-GC-when-locking-unlocking-files.patch (text/x-patch, attachment)]
[0003-Refactor-current_lock_owner.patch (text/x-patch, attachment)]
[0004-Remove-empty-invalid-lock-files.patch (text/x-patch, attachment)]

This bug report was last modified 277 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.