Skip to contentSkip to conversation

Introduction

PATCH New Olaf Kirch 1 participant 1 message Jul 11, 2005

Subsystems (2)
lore
Share & tools
lore

Olaf Kirch

author
#0 lore raw

PATCH 1/1 Introduction

I recently debugged various file NFS locking problems caused by an application that would open and close files in one thread, and obtain posix locks on these file in a second thread. Using a test app, I could trigger a BUG() in locks_remove_flock within seconds, because there were still POSIX locks attached to the filp by the time of the final fput(). In addition, stale locks would accumulate on the NFS server.

While this is arguably stupid behavior on the application's part, I think the kernel should nevertheless not get confused by this. The following three patches fix three separate issues

1: Fixes a miscompare when establishing a lock, which would
cause the same lock to be established twice.
2: locks_remove_posix would issue a single unlock call using
the tgid of the current process, which may not be the tgid of the lock. This will cause stale NFS locks not owned by anyone.
3: fix the above mentioned race condition

Cheers
Olaf

Signature · 12 lines
Olaf Kirch   |  --- o --- Nous sommes du soleil we love when we play
[email protected] |    / | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs