locks: internal lease API overhaul
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest17 patches 31 repliesIn review
Changes in v2 from the cover letter
- cleanups and fixes in response to HCH's review
- make security_file_set_fowner a void return operation
- consolidate "nosetlease" routines
- remove "deadlock protection" from generic_add_lease routine
- add return value to lm_break op to allow for direct lease removal
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | locks: consolidate "nolease" routinesfs/ fs/ fs/ +3 more | +20 | 6 replies | |
| 2/17 | security: make security_file_set_fowner, f_setown and __f_setown void returndrivers/ drivers/ fs/ +9 more | +25 | 5 replies | |
| 3/17 | locks: close potential race in lease_get_mtimefs/ | +12 | 0 replies | |
| 4/17 | nfsd: fix potential lease memory leak in nfs4_setleasefs/ | +5 | 0 replies | |
| 5/17 | locks: generic_delete_lease doesn't need a file_lock at allfs/ fs/ include/ | +22 | 5 replies | |
| 6/17 | locks: clean up vfs_setlease kerneldoc commentsfs/ | +10 | 0 replies | |
| 7/17 | nfsd: don't keep a pointer to the lease in nfs4_filefs/ fs/ | +4 | 2 replies | |
| 8/17 | locks: plumb a "priv" pointer into the setlease routinesfs/ fs/ fs/ +2 more | +35 | 1 reply | |
| 9/17 | locks: define a lm_setup handler for leasesfs/ fs/ include/ | +51 | 1 reply | |
| 10/17 | locks: move i_lock acquisition into generic_*_lease handlersfs/ | +9 | 0 replies | |
| 11/17 | locks: move freeing of leases outside of i_lockfs/ fs/ include/ | +29 | 2 replies | |
| 12/17 | locks: update Documentation/filesystems with new setlease semanticsDocumentation/ Documentation/ | +10 | 2 replies | |
| 13/17 | locks: remove i_have_this_lease check from __break_leasefs/ | +2 | 2 replies | |
| 14/17 | locks: __break_lease cleanup in preparation of allowing direct removal of leasesfs/ | +25 | 2 replies | |
| 15/17 | locks: give lm_break a return valuefs/ fs/ include/ | +23 | 1 reply | |
| 16/17 | locks: set fl_owner for leases to filp instead of current->filesfs/ | +1 | 0 replies | |
| 17/17 | locks: clean up comments over fl_owner_t definitioninclude/ | +12 | 2 replies |
Reviews trailers per patch
14 of 17 patches have a Reviewed-by or Acked-by.
| Patch | Christoph Hellwig | Trond Myklebust |
|---|---|---|
| 1/17 | R-b | A-b |
| 2/17 | R-b | |
| 3/17 | R-b | |
| 4/17 | R-b | |
| 5/17 | R-b | |
| 6/17 | R-b | |
| 7/17 | R-b | |
| 8/17 | R-b | |
| 9/17 | R-b | |
| 10/17 | R-b | |
| 11/17 | R-b | |
| 12/17 | R-b | |
| 13/17 | ||
| 14/17 | R-b | |
| 15/17 | R-b | |
| 16/17 | ||
| 17/17 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 00/17] locks: internal lease API overhaul
v2:
- cleanups and fixes in response to HCH's review
- make security_file_set_fowner a void return operation
- consolidate "nosetlease" routines
- remove "deadlock protection" from generic_add_lease routine
- add return value to lm_break op to allow for direct lease removal
The internal "API" for handling leases has a lot of problems. The main one is that on success it can return a pointer to a lease that sits on the inode's i_flock list. That pointer is only guaranteed to be valid until the i_lock is dropped, which makes it a bit dangerous to use.
Also, the i_lock is held over much too much of the code, which precludes any hope of ever adding proper support for leases to distributed filesystems.
This patchset is a cleanup and overhaul of the internal lease API, and a few stray locking-related patches. It fixes a number of problems in that code and makes an attempt at making that API more sane to use.
The only real consumer of that API is knfsd, but this should make it easier for others to do so, reduce and clarify the spinlocking involved in handling leases, and get us a step closer toward allowing lease implementations that can block.
I'm targeting this work for v3.18. Review would be welcome...
Jeff Layton (17):
locks: consolidate "nolease" routines
security: make security_file_set_fowner, f_setown and __f_setown void
return
locks: close potential race in lease_get_mtime
nfsd: fix potential lease memory leak in nfs4_setlease
locks: generic_delete_lease doesn't need a file_lock at all
locks: clean up vfs_setlease kerneldoc comments
nfsd: don't keep a pointer to the lease in nfs4_file
locks: plumb a "priv" pointer into the setlease routines
locks: define a lm_setup handler for leases
locks: move i_lock acquisition into generic_*_lease handlers
locks: move freeing of leases outside of i_lock
locks: update Documentation/filesystems with new setlease semantics
locks: remove i_have_this_lease check from __break_lease
locks: __break_lease cleanup in preparation of allowing direct removal
of leases
locks: give lm_break a return value
locks: set fl_owner for leases to filp instead of current->files
locks: clean up comments over fl_owner_t definition
Documentation/filesystems/Locking | 11 +- Documentation/filesystems/vfs.txt | 7 +- drivers/net/tun.c | 4 +- drivers/tty/tty_io.c | 3 +- fs/cifs/cifsfs.c | 7 +- fs/fcntl.c | 21 +-- fs/gfs2/file.c | 22 +-- fs/libfs.c | 18 +++ fs/locks.c | 297 ++++++++++++++++++++------------------ fs/nfs/file.c | 13 +- fs/nfs/internal.h | 1 - fs/nfs/nfs4file.c | 2 +- fs/nfsd/nfs4state.c | 44 +++--- fs/nfsd/state.h | 1 - fs/notify/dnotify/dnotify.c | 8 +- include/linux/fs.h | 41 ++++-- include/linux/security.h | 8 +- include/trace/events/filelock.h | 14 +- net/socket.c | 3 +- security/capability.c | 4 +- security/security.c | 2 +- security/selinux/hooks.c | 4 +- security/smack/smack_lsm.c | 3 +- 23 files changed, 269 insertions(+), 269 deletions(-)
Signature · 1 line
1.9.3