From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.7) Gecko/20050416 Red Hat/1.0.3-1.4.1 Firefox/1.0.3 Description of problem: There is a race between fcntl and close which can result in orphanned POSIX locks. In general, these races are handled via the support to remove locks when the last reference to an open file is released. Sometimes, this does not occur in a timely fashion and could cause problems. This can happen because an application was holding a reference to an open file, which would delay the last reference to an open file being released. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Compile and run the attach test program. Actual Results: The test program attempts to lock what should be a completely unlocked file. The lock attempt fails because there is a lock outstanding on the file, long after it should have been released. Expected Results: The lock attempt made in the test program should succeed. Additional info: This bug has already been fixed in RHEL 3 U6. The problem continues to exist in RHEL 4, although not with the same severity.
Created attachment 115635 [details] Test program to reproduce the situation.
The test program should be run with a "delay" argument of at least 30 seconds. This is due to some issue with the multithreading on RHEL 4 which I've not looked into yet.
Created attachment 116125 [details] Proposed patch
A patch containing these changes has been accepted upstream into the '-mm' release.
Created attachment 117209 [details] Proposed patch
The proposed patch was sent upstream. After review, it was simplified very slightly and has been sent to Linus for inclusion into his kernel.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2006-0132.html