[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/2] block: report errno when flock fcntl fails
From: |
David Edmondson |
Subject: |
Re: [PATCH v2 1/2] block: report errno when flock fcntl fails |
Date: |
Wed, 06 Jan 2021 11:58:48 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
On Wednesday, 2021-01-06 at 10:48:09 +01, Max Reitz wrote:
> On 21.12.20 14:49, David Edmondson wrote:
>> When a call to fcntl(2) for the purpose of manipulating file locks
>> fails, report the error returned by fcntl.
>> Signed-off-by: David Edmondson <david.edmondson@oracle.com>
>> ---
>> block/file-posix.c | 20 +++++-----
>> tests/qemu-iotests/153.out | 76 +++++++++++++++++++-------------------
>> tests/qemu-iotests/182.out | 2 +-
>> 3 files changed, 49 insertions(+), 49 deletions(-)
>
> tests/qemu-iotests/296.out also needs to be adjusted (found by
> grepping for 'Failed to get').
I will check and add it.
> And now I might as well add this idea: EAGAIN is the most common errno
> when flock fcntl fails, so would it make sense to generate a custom
> error message then? I’d like to think we could do better than
> “Resource temporarily unavailable”, e.g. perhaps “Lock is already
> taken”.
Kevin previously suggested that we should elide the detail in this
common case (please correct me if that's a misrepresentation), but there
didn't seem to be any consensus for that.
> OTOH, “Resource temporarily unavailable” isn’t *that* bad, so if you
> don’t want to, I won’t push for it.
Other than that it's just more code (which in general is not good), I
don't have a strong opinion.
dme.
--
Facts don't do what I want them to.