[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that
From: |
Matt Armstrong |
Subject: |
bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file |
Date: |
Fri, 12 Feb 2021 15:59:40 -0800 |
Eli Zaretskii <eliz@gnu.org> writes:
>> Cc: gmatta@gmail.com, 46397@debbugs.gnu.org, craven@gmx.net,
>> Matt Armstrong <matt@rfc20.org>
>> From: Paul Eggert <eggert@cs.ucla.edu>
>> Date: Fri, 12 Feb 2021 01:36:30 -0800
>>
>> > The Posix spec of 'unlink' says:
>>
>> Matt was talking about current_lock_owner, a function that does not call
>> 'unlink', so it's not clear why the 'unlink' spec is relevant here.
>
> Is the description for other APIs significantly different? If not,
> then this details is not important.
>
>> current_lock_owner eventually calls either readlinkat or (on systems
>> without symlinks) openat. If either fails with ENOTDIR, some ancestor of
>> the lock file is a non-directory, hence the lock file itself cannot
>> possibly exist and therefore it must be the case that nobody owns the
>> lock.
>
> Nobody owns the lock _now_, but how did that come to happen? We have
> no idea. It could be an indication that the user's files are under
> attack, for example. So silently assuming that the lock doesn't exist
> is not necessarily TRT.
I think this portion of the discussion is on the fringe of the important
issue. Right now, 'current_lock_owner' can return arbitrary errno
values, and if it does Emacs is in a bad situation:
a) The user can't kill the buffer interactively.
b) Emacs can't exit, gets in a bad state, and must be killed.
So, definitely, we need to fix that.
Separately, I continue to think Paul's recent commit is fine. With due
consideration to the issue of inferring too much about system state
based on errno inspection, ENOTDIR and ENOENT are both unambiguously
specified for the functions 'current_lock_owner' calls -- to mean the
path components that should be directories are not in fact directories
-- and so both errno values imply that the lock file isn't at the path
Emacs is has associated with the buffer.
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Peter, 2021/02/09
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Matt Armstrong, 2021/02/09
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Matt Armstrong, 2021/02/09
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Eli Zaretskii, 2021/02/10
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Paul Eggert, 2021/02/10
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Eli Zaretskii, 2021/02/10
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Matt Armstrong, 2021/02/10
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Eli Zaretskii, 2021/02/12
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Paul Eggert, 2021/02/12
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Eli Zaretskii, 2021/02/12
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file,
Matt Armstrong <=
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Eli Zaretskii, 2021/02/13
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Matt Armstrong, 2021/02/11
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Paul Eggert, 2021/02/11
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Eli Zaretskii, 2021/02/12
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Matt Armstrong, 2021/02/12
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Paul Eggert, 2021/02/12
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Eli Zaretskii, 2021/02/13
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Eli Zaretskii, 2021/02/13
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Matt Armstrong, 2021/02/13
- bug#46397: 27.1; Cannot delete buffer pointing to a file in a path that includes a file, Eli Zaretskii, 2021/02/14