All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/17] locks: internal lease API overhaul
@ 2014-09-04 12:38 Jeff Layton
  2014-09-04 12:38   ` Jeff Layton
                   ` (16 more replies)
  0 siblings, 17 replies; 83+ messages in thread
From: Jeff Layton @ 2014-09-04 12:38 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-nfs, Christoph Hellwig, J. Bruce Fields, linux-kernel

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(-)

-- 
1.9.3


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

end of thread, other threads:[~2015-01-13  2:14 UTC | newest]

Thread overview: 83+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-04 12:38 [PATCH v2 00/17] locks: internal lease API overhaul Jeff Layton
2014-09-04 12:38 ` [PATCH v2 01/17] locks: consolidate "nolease" routines Jeff Layton
2014-09-04 12:38   ` [Cluster-devel] " Jeff Layton
2014-09-04 12:38   ` Jeff Layton
2014-09-04 12:41   ` Trond Myklebust
2014-09-04 12:41     ` [Cluster-devel] " Trond Myklebust
2014-09-04 12:41     ` Trond Myklebust
2014-09-04 12:49     ` Jeff Layton
2014-09-04 12:49       ` [Cluster-devel] " Jeff Layton
2014-09-04 12:49       ` Jeff Layton
2014-09-04 18:25       ` Trond Myklebust
2014-09-04 18:25         ` [Cluster-devel] " Trond Myklebust
2014-09-04 20:12         ` Christoph Hellwig
2014-09-04 20:12           ` [Cluster-devel] " Christoph Hellwig
2014-09-05 11:48           ` Jeff Layton
2014-09-05 11:48             ` [Cluster-devel] " Jeff Layton
2014-09-05 11:48             ` Jeff Layton
2014-09-04 17:46   ` Christoph Hellwig
2014-09-04 17:46     ` [Cluster-devel] " Christoph Hellwig
2014-09-04 17:46     ` Christoph Hellwig
2014-09-04 12:38 ` [PATCH v2 02/17] security: make security_file_set_fowner, f_setown and __f_setown void return Jeff Layton
2014-09-04 17:47   ` Christoph Hellwig
2014-10-07 17:11   ` Dmitry Kasatkin
2014-10-07 17:17     ` Christoph Hellwig
2014-10-07 17:34       ` Dmitry Kasatkin
2014-10-07 17:34         ` Dmitry Kasatkin
2014-10-07 18:02         ` Jeff Layton
2014-09-04 12:38 ` [PATCH v2 03/17] locks: close potential race in lease_get_mtime Jeff Layton
2014-09-04 12:38 ` [PATCH v2 04/17] nfsd: fix potential lease memory leak in nfs4_setlease Jeff Layton
2014-09-04 12:38 ` [PATCH v2 05/17] locks: generic_delete_lease doesn't need a file_lock at all Jeff Layton
2014-09-04 20:14   ` Christoph Hellwig
2014-09-04 20:14     ` Christoph Hellwig
2014-09-05  0:29     ` Jeff Layton
2014-09-05  0:29       ` Jeff Layton
2015-01-12 23:03   ` NeilBrown
2015-01-12 23:03     ` NeilBrown
2015-01-12 23:25     ` Jeff Layton
2015-01-13  2:14       ` NeilBrown
2015-01-13  2:14         ` NeilBrown
2014-09-04 12:38 ` [PATCH v2 06/17] locks: clean up vfs_setlease kerneldoc comments Jeff Layton
2014-09-04 12:38 ` [PATCH v2 07/17] nfsd: don't keep a pointer to the lease in nfs4_file Jeff Layton
2014-09-05 21:40   ` J. Bruce Fields
2014-09-05 21:40     ` J. Bruce Fields
2014-09-06 12:33     ` Jeff Layton
2014-09-06 12:33       ` Jeff Layton
2014-09-04 12:38 ` [PATCH v2 08/17] locks: plumb a "priv" pointer into the setlease routines Jeff Layton
2014-09-04 17:48   ` Christoph Hellwig
2014-09-04 12:38 ` [PATCH v2 09/17] locks: define a lm_setup handler for leases Jeff Layton
2014-09-04 12:38   ` Jeff Layton
2014-09-04 17:49   ` Christoph Hellwig
2014-09-04 17:49     ` Christoph Hellwig
2014-09-04 12:38 ` [PATCH v2 10/17] locks: move i_lock acquisition into generic_*_lease handlers Jeff Layton
2014-09-04 12:38 ` [PATCH v2 11/17] locks: move freeing of leases outside of i_lock Jeff Layton
2014-09-04 17:50   ` Christoph Hellwig
2014-09-04 17:50     ` Christoph Hellwig
2014-09-05 14:03     ` Jeff Layton
2014-09-04 12:38 ` [PATCH v2 12/17] locks: update Documentation/filesystems with new setlease semantics Jeff Layton
2014-09-04 17:50   ` Christoph Hellwig
2014-09-04 17:50     ` Christoph Hellwig
2014-09-05 14:02     ` Jeff Layton
2014-09-05 14:02       ` Jeff Layton
2014-09-04 12:38 ` [PATCH v2 13/17] locks: remove i_have_this_lease check from __break_lease Jeff Layton
2014-09-04 12:38   ` Jeff Layton
2014-09-04 17:51   ` Christoph Hellwig
2014-09-04 17:51     ` Christoph Hellwig
2014-09-04 18:03     ` Jeff Layton
2014-09-04 18:03       ` Jeff Layton
2014-09-04 12:38 ` [PATCH v2 14/17] locks: __break_lease cleanup in preparation of allowing direct removal of leases Jeff Layton
2014-09-04 18:07   ` Christoph Hellwig
2014-09-04 18:07     ` Christoph Hellwig
2014-09-05 13:35     ` Jeff Layton
2014-09-05 13:35       ` Jeff Layton
2014-09-04 12:38 ` [PATCH v2 15/17] locks: give lm_break a return value Jeff Layton
2014-09-04 12:38   ` Jeff Layton
2014-09-04 18:08   ` Christoph Hellwig
2014-09-04 18:08     ` Christoph Hellwig
2014-09-04 12:38 ` [PATCH v2 16/17] locks: set fl_owner for leases to filp instead of current->files Jeff Layton
2014-09-04 12:38   ` Jeff Layton
2014-09-04 12:38 ` [PATCH v2 17/17] locks: clean up comments over fl_owner_t definition Jeff Layton
2014-09-04 17:53   ` Christoph Hellwig
2014-09-04 17:53     ` Christoph Hellwig
2014-09-05 13:36     ` Jeff Layton
2014-09-05 13:36       ` Jeff Layton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.