Bug 189975 - Enable NLM to use f_op->lock interface
Summary: Enable NLM to use f_op->lock interface
Keywords:
Status: CLOSED DUPLICATE of bug 196318
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Wendy Cheng
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-26 12:15 UTC by Wendy Cheng
Modified: 2007-11-30 22:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-04-26 21:45:24 UTC
Target Upstream Version:
Embargoed:


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

Description Wendy Cheng 2006-04-26 12:15:04 UTC
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 12:15:04 UTC
Created attachment 128249 [details]
Test patch for this issue - changes posix_lock_file() in fs/locks.c.

Comment 2 Wendy Cheng 2006-04-27 19:06:36 UTC
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 21:45:24 UTC
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.