Commit 6aaafc43 authored by Jeff Layton's avatar Jeff Layton Committed by J. Bruce Fields

nfsd: wake waiters blocked on file_lock before deleting it

After a blocked nfsd file_lock request is deleted, knfsd will send a
callback to the client and then free the request. Commit 16306a61
("fs/locks: always delete_block after waiting.") changed it such that
locks_delete_block is always called on a request after it is awoken,
but that patch missed fixing up blocked nfsd request handling.

Call locks_delete_block on the block to wake up any locks still blocked
on the nfsd lock request before freeing it. Some of its callers already
do this however, so just remove those calls.

URL: https://bugzilla.kernel.org/show_bug.cgi?id=203363
Fixes: 16306a61 ("fs/locks: always delete_block after waiting.")
Reported-by: default avatarSlawomir Pryczek <slawek1211@gmail.com>
Cc: Neil Brown <neilb@suse.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent e6abc8ca
...@@ -265,6 +265,7 @@ find_or_allocate_block(struct nfs4_lockowner *lo, struct knfsd_fh *fh, ...@@ -265,6 +265,7 @@ find_or_allocate_block(struct nfs4_lockowner *lo, struct knfsd_fh *fh,
static void static void
free_blocked_lock(struct nfsd4_blocked_lock *nbl) free_blocked_lock(struct nfsd4_blocked_lock *nbl)
{ {
locks_delete_block(&nbl->nbl_lock);
locks_release_private(&nbl->nbl_lock); locks_release_private(&nbl->nbl_lock);
kfree(nbl); kfree(nbl);
} }
...@@ -293,7 +294,6 @@ remove_blocked_locks(struct nfs4_lockowner *lo) ...@@ -293,7 +294,6 @@ remove_blocked_locks(struct nfs4_lockowner *lo)
nbl = list_first_entry(&reaplist, struct nfsd4_blocked_lock, nbl = list_first_entry(&reaplist, struct nfsd4_blocked_lock,
nbl_lru); nbl_lru);
list_del_init(&nbl->nbl_lru); list_del_init(&nbl->nbl_lru);
locks_delete_block(&nbl->nbl_lock);
free_blocked_lock(nbl); free_blocked_lock(nbl);
} }
} }
...@@ -4863,7 +4863,6 @@ nfs4_laundromat(struct nfsd_net *nn) ...@@ -4863,7 +4863,6 @@ nfs4_laundromat(struct nfsd_net *nn)
nbl = list_first_entry(&reaplist, nbl = list_first_entry(&reaplist,
struct nfsd4_blocked_lock, nbl_lru); struct nfsd4_blocked_lock, nbl_lru);
list_del_init(&nbl->nbl_lru); list_del_init(&nbl->nbl_lru);
locks_delete_block(&nbl->nbl_lock);
free_blocked_lock(nbl); free_blocked_lock(nbl);
} }
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment