Linus Torvalds wrote: > > On Sat, 5 May 2001, Manfred Spraul wrote: > > > > * missing/wrong lock_kernel calls in fs/fcntl.c: getlk/setlk run without > > the big kernel lock. The ..64 function acquire the lock. > > This is wrong. The big lock (if it is needed, but I thought the current > locking should be safe) should be pushed down into the point where it is > needed, not at the caller.. > Ok, I've removed the locks from fs/fcntl.c and added them into fs/locks.c: * fcntl_getlease dereferences filp->f_dentry->d_inode->i_flock. Race with multithreaded app: sys_close()->filp_close()->locks_remove_posix() + fcntl_getlease() * according to Documentation/filesystems/Locking, f_op->lock() is called with the blk acquired. lock added around that call in fcntl_{get,set}lk{,64} I've attached a new patch. -- Manfred