Bug 136305 - gdbm prefers flock over fcntl when being built
gdbm prefers flock over fcntl when being built
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gdbm (Show other bugs)
3.0
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Jeff Johnson
Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-19 05:50 EDT by Ralph Angenendt
Modified: 2015-01-07 19:08 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-29 16:56:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Patch for systems.h which checks for fcntl first (1.58 KB, patch)
2004-10-19 05:51 EDT, Ralph Angenendt
no flags Details | Diff
patch to allow gdbm to use fcntl even if flock is present (817 bytes, patch)
2004-12-17 12:46 EST, Neil Horman
no flags Details | Diff
Fixed version of patch for systems.h which checks for fcntl first (1.49 KB, patch)
2004-12-20 06:13 EST, Adam Spiers
no flags Details | Diff

  None (edit)
Description Ralph Angenendt 2004-10-19 05:50:08 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7)
Gecko/20040808 Lightninganemone/0.9.3 (Firefox/0.9.3 gotcha)

Description of problem:
With gdbm it is not possible to lock files via nfs, as gdbm has been
built against flock, which "the sourcecode" prefers over fcntl (in
systems.h HAVE_FLOCK is tested, if - and only then - this fails,
locking gets defined for fcntl).

As no Posix locking is available, using gdbm via NFS fails with "No
locks available".

When being built, availability of fcntl should be checked first, only
if it is not available do a fallback on flock.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. install gdbm
2. try dbm_open() on a file exported via NFS
3.
    

Actual Results:  The program fails with "No locks available"

Expected Results:  It should have opened the database.

Additional info:
Comment 1 Ralph Angenendt 2004-10-19 05:51:43 EDT
Created attachment 105433 [details]
Patch for systems.h which checks for fcntl first

When being rebuild with this patch, gdbm uses fcntl over flock, so that posix
locking is possible
Comment 2 Adam Spiers 2004-12-17 07:31:31 EST
See also bug #123415
Comment 3 Neil Horman 2004-12-17 12:46:48 EST
Created attachment 108815 [details]
patch to allow gdbm to use fcntl even if flock is present

This patch adds a configure script option to gdbm so that even if flock is
detected during configuration, fcntl will be used to lock files.  This will
allow the package to be rebuilt to work over NFS by adding a
--enable-force-fcntl flag on the %configure line of the gdbm spec file.
Comment 4 Adam Spiers 2004-12-20 06:10:24 EST
Is there any reason ever to prefer flock to fcntl if both are available?

If not, I would prefer the first approach - it's better to
automatically always make the right decision rather requiring the
person building the package to override the wrong decision via
--enable-force-fcntl.  Unless you have some other reasons I haven't
thought of for taking this latter approach?
Comment 5 Adam Spiers 2004-12-20 06:13:16 EST
Created attachment 108884 [details]
Fixed version of patch for systems.h which checks for fcntl first

The first patch didn't apply to 1.8.0 cleanly for me.  Attaching a version
which does; should be identical in functionality.

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