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.