Bug 189975 - Enable NLM to use f_op->lock interface
Enable NLM to use f_op->lock interface
Status: CLOSED DUPLICATE of bug 196318
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Wendy Cheng
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-26 08:15 EDT by Wendy Cheng
Modified: 2007-11-30 17:07 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-04-26 17:45:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test patch for this issue - changes posix_lock_file() in fs/locks.c. (484 bytes, text/plain)
2006-04-26 08:15 EDT, Wendy Cheng
no flags Details

  None (edit)
Description Wendy Cheng 2006-04-26 08:15:04 EDT
Description of problem:

The struct file_operations (include/linux/fs.h) has "lock" 
defineds: 

int (*lock) (struct file *, int, struct file_lock *);

and system call interfaces (sys_fcntl and sys_flock) have 
been calling this interface to invoke filesystem specific 
lock functions. Unfortunately, NLM and NFS v4 code, using
posix_lock_file() VFS call, do not follow this (i.e., they
do not invoke f_op->lock in the code patch at all).

This may not be an issue for local filesystem such as ext3 
(that doesn't define its own "lock" method) but it is a 
nontrivial function flaw for cluster filesystem such as GFS. 
The implication here is that GFS can't do file locking 
across different nodes if accessed from NFS export.  

Version-Release number of selected component (if applicable):
All NLM and NFS v4 code within RHEL versions, including 
upstream kernels. 

How reproducible:
Each time and every time


Steps to Reproduce:
1. Export GFS share via NFS
2. Lock the file via fcntl() from different NFS clients
  
Actual results:
The lock calls completes. 

Expected results:
For exclusive locks such as F_WRLCK, only one call 
should go thru. 

Additional info:
Note that the result is correct if the file is locked via
local access (i.e., invoking fcntl() directly from different 
GFS nodes). In simple words, the VFS layer behaves correctly
but not NLM and NFS v4 code.
Comment 1 Wendy Cheng 2006-04-26 08:15:04 EDT
Created attachment 128249 [details]
Test patch for this issue - changes posix_lock_file() in fs/locks.c.
Comment 2 Wendy Cheng 2006-04-27 15:06:36 EDT
I have a typo in the "Steps to Reproduce":

"2. Lock the file via fcntl() from different NFS clients" should be:

2. Lock the (same) GFS file via fcntl() to different NFS servers. 
Comment 6 Wendy Cheng 2007-04-26 17:45:24 EDT
IBM opened an identical bugzilla (196318) - since it has an IT ticket 
attached to IT, I'll cancel mine. 


*** This bug has been marked as a duplicate of 196318 ***

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