linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] locks: allow mandatory locking to work with file-private locks
@ 2014-03-10 13:36 Jeff Layton
  2014-03-10 13:36 ` [PATCH 1/2] locks: fix locks_mandatory_locked to respect " Jeff Layton
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Jeff Layton @ 2014-03-10 13:36 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: bfields, trond.myklebust, Andy Lutomirski

This patchset fixes the problems that Trond pointed out last week,
namely that you can end up deadlocking yourself if you set a
file-private lock on a file and then do some I/O on the same.

With this set, mandatory locking should work more or less as you'd
expect with file-private locks. If you set a lock on an open file
and then do some I/O on it, it won't block. If you try to lock and
do I/O on different open files, then the I/O may end up blocked.

Note that this approach is just as racy as the existing mandatory
lock implementation, but I don't think it makes anything worse there.

Jeff Layton (2):
  locks: fix locks_mandatory_locked to respect file-private locks
  locks: make locks_mandatory_area check for file-private locks

 fs/locks.c         | 22 +++++++++++++++++-----
 fs/namei.c         |  2 +-
 include/linux/fs.h | 20 ++++++++++----------
 mm/mmap.c          |  2 +-
 mm/nommu.c         |  2 +-
 5 files changed, 30 insertions(+), 18 deletions(-)

-- 
1.8.5.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-03-10 19:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-10 13:36 [PATCH 0/2] locks: allow mandatory locking to work with file-private locks Jeff Layton
2014-03-10 13:36 ` [PATCH 1/2] locks: fix locks_mandatory_locked to respect " Jeff Layton
2014-03-10 19:04   ` J. Bruce Fields
2014-03-10 13:36 ` [PATCH 2/2] locks: make locks_mandatory_area check for " Jeff Layton
2014-03-10 17:07   ` Andy Lutomirski
2014-03-10 17:31     ` Jeffrey Layton
2014-03-10 17:37       ` Andy Lutomirski
2014-03-10 17:47         ` Jeffrey Layton
2014-03-10 19:21 ` [PATCH 0/2] locks: allow mandatory locking to work with " J. Bruce Fields
2014-03-10 19:31   ` Jeffrey Layton
2014-03-10 19:37     ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).