Bug 1461231 - [RFE] Support OFD locking constants (glibc)
[RFE] Support OFD locking constants (glibc)
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: glibc team
: FutureFeature, Patch
Depends On: 1444778
Blocks: 1378241
  Show dependency treegraph
Reported: 2017-06-13 21:28 EDT by Ademar Reis
Modified: 2017-09-21 13:54 EDT (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1444778
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ademar Reis 2017-06-13 21:28:10 EDT
+++ This bug was initially created as a clone of Bug #1444778 +++

F_OFD_* locking API is superior to posix locks and flock(1), we need it in RHEL to support applications doing proper file locking.

The problem with posix locks are described in


The disadvantage with flock(1) is it doesn't reliably work in certain cases like NFS (where it is translated to posix locks).

As a concrete requirement, QEMU wants to use OFD locks to protect image files it opens, so that no concurrent writtings from different processes can happen, which would corrupt a qcow2 image, as an example.

--- Additional comment from Jeff Layton on 2017-04-24 18:48:27 BRT ---

It's certainly doable to add it, and I don't think it'd be problematic for kABI. 

Note that we'd also need to coordinate this with the companion glibc patches as well.

--- Additional comment from Eric Sandeen on 2017-04-24 18:55:13 BRT ---

I'm not sure that glibc can add new syscalls to a RHEL release w/o ABI problems - we ran into that back in the fallocate days ...

--- Additional comment from Jeff Layton on 2017-04-24 19:01:52 BRT ---

We don't need a new syscall here. It's just a matter of adding the F_OFD_* constants to the headers (and updating the docs if we care about that). If the kernel doesn't recognize the F_OFD_* commands, then it will just return -EINVAL.

QEMU or whatever will need to be able to detect that as well.
Comment 1 Carlos O'Donell 2017-06-15 00:49:33 EDT
We are currently in the practice of adding new constants to header files to enable kernel functionality, and this is just such a request, so we shouldn't have any real problem adding this to rhel-7.5.

The upstream commit is here:

commit 0961f7e1e300ef633b0c1ad95d0999fb5c169f4e
Author: Jeff Layton <jlayton@poochiereds.net>
Date:   Wed Jul 23 14:21:05 2014 -0400

    fcntl-linux.h: add new definitions and manual updates for open file description locks
    Open file description locks have been merged into the Linux kernel for
    v3.15.  Add the appropriate command-value definitions and an update to
    the manual that describes their usage.

Note You need to log in before you can comment on or make changes to this bug.