Skip to content

locks: allow mandatory locking to work with file-private locks

Jeff Layton linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2locks: fix locks_mandatory_locked to respect file-private locksfs/locks.c fs/namei.c include/linux/fs.h +2 more+17 -161 reply
2/2locks: make locks_mandatory_area check for file-private locksfs/locks.c+13 -24 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJ. Bruce Fields
1/2A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] locks: allow mandatory locking to work with file-private locks

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(-)
Signature · 1 line
1.8.5.3