[Top][All Lists]

[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: Max Reitz
Subject: Re: [PATCH v2 1/2] block: report errno when flock fcntl fails
Date: Wed, 6 Jan 2021 10:48:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0

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').

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”.

OTOH, “Resource temporarily unavailable” isn’t *that* bad, so if you don’t want to, I won’t push for it.


reply via email to

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