block: report errno when flock fcntl fails
commit797e3e380534bddad32121bfc980a39cc3dd2c96
authorDavid Edmondson <david.edmondson@oracle.com>
Wed, 13 Jan 2021 16:44:47 +0000 (13 16:44 +0000)
committerMax Reitz <mreitz@redhat.com>
Tue, 26 Jan 2021 13:36:37 +0000 (26 14:36 +0100)
tree8ad4204984b799edc05caa465b0446fd7095d84d
parentc701f59253c7b69f51364c04e55278e38364738e
block: report errno when flock fcntl fails

When a call to fcntl(2) for the purpose of adding file locks fails
with an error other than EAGAIN or EACCES, report the error returned
by fcntl.

EAGAIN or EACCES are elided as they are considered to be common
failures, indicating that a conflicting lock is held by another
process.

No errors are elided when removing file locks.

Signed-off-by: David Edmondson <david.edmondson@oracle.com>
Message-Id: <20210113164447.2545785-1-david.edmondson@oracle.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/file-posix.c