locks: always unlock on close
Subsystems (4)
A message that is not in the archive (sent off-list or not yet received): 11704806552464-git-send-email-
PATCH 1/14 locks: always unlock on close
From: Marc Eshel <[email protected]> - unquoted
Currently locks_remove_posix has a shortcut which returns without doing anything if it doesn't see anything on the inode's lock list.
That may be the wrong thing to do if a filesystem (such as a network or cluster filesystem) wants to bookkeep locks on its own.
A filesystem should still be able to keep track of locally held locks (such as all the locks held by one local process), but the occasional kmalloc() failure, for example, could get the two sets of data structures out of sync, and it seems best to allow the filesystem to be authoritative.
--- fs/locks.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)
fs/locks.c +0 -8
@@ -1917,14 +1917,6 @@ void locks_remove_posix(struct file *filp, fl_owner_t owner) {struct file_lock lock; -/* -* If there are no locks held on this file, we don't need to call -* posix_lock_file(). Another process could be setting a lock on this -* file at the same time, but we wouldn't remove that lock anyway. -*/ -if (!filp->f_path.dentry->d_inode->i_flock) -return ; - lock.fl_type =F_UNLCK ; lock.fl_flags =FL_POSIX |FL_CLOSE ; lock.fl_start =0 ;
Signature · 11 lines
1.5.0.rc1.g72fe ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs
PATCH 1/14 locks: always unlock on close
In reply to a message not in the archiveFrom: Marc Eshel <[email protected]> - unquoted
Currently locks_remove_posix has a shortcut which returns without doing anything if it doesn't see anything on the inode's lock list.
That may be the wrong thing to do if a filesystem (such as a network or cluster filesystem) wants to bookkeep locks on its own.
A filesystem should still be able to keep track of locally held locks (such as all the locks held by one local process), but the occasional kmalloc() failure, for example, could get the two sets of data structures out of sync, and it seems best to allow the filesystem to be authoritative.
--- fs/locks.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)
fs/locks.c +0 -8
@@ -1917,14 +1917,6 @@ void locks_remove_posix(struct file *filp, fl_owner_t owner) {struct file_lock lock; -/* -* If there are no locks held on this file, we don't need to call -* posix_lock_file(). Another process could be setting a lock on this -* file at the same time, but we wouldn't remove that lock anyway. -*/ -if (!filp->f_path.dentry->d_inode->i_flock) -return ; - lock.fl_type =F_UNLCK ; lock.fl_flags =FL_POSIX |FL_CLOSE ; lock.fl_start =0 ;
Signature · 1 line
1.5.0.rc1.g72fe