diff options
author | Jeff Layton <jlayton@primarydata.com> | 2014-08-11 20:20:31 +0200 |
---|---|---|
committer | Jeff Layton <jlayton@primarydata.com> | 2014-08-14 16:07:47 +0200 |
commit | ed9814d85810c27670987b40c77e8a07105838fe (patch) | |
tree | 445d69a6adf6a9f9aaedd118f714c07abc96ba1b /fs/fcntl.c | |
parent | locks: don't reuse file_lock in __posix_lock_file (diff) | |
download | linux-ed9814d85810c27670987b40c77e8a07105838fe.tar.xz linux-ed9814d85810c27670987b40c77e8a07105838fe.zip |
locks: defer freeing locks in locks_delete_lock until after i_lock has been dropped
In commit 72f98e72551fa (locks: turn lock_flocks into a spinlock), we
moved from using the BKL to a global spinlock. With this change, we lost
the ability to block in the fl_release_private operation.
This is problematic for NFS (and probably some other filesystems as
well). Add a new list_head argument to locks_delete_lock. If that
argument is non-NULL, then queue any locks that we want to free to the
list instead of freeing them.
Then, add a new locks_dispose_list function that will walk such a list
and call locks_free_lock on them after the i_lock has been dropped.
Finally, change all of the callers of locks_delete_lock to pass in a
list_head, except for lease_modify. That function can be called long
after the i_lock has been acquired. Deferring the freeing of a lease
after unlocking it in that function is non-trivial until we overhaul
some of the spinlocking in the lease code.
Currently though, no filesystem that sets fl_release_private supports
leases, so this is not currently a problem. We'll eventually want to
make the same change in the lease code, but it needs a lot more work
before we can reasonably do so.
Acked-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Diffstat (limited to 'fs/fcntl.c')
0 files changed, 0 insertions, 0 deletions