Skip to content

Commit 6aaafc4

Browse files
jtlaytonJ. Bruce Fields
authored andcommitted
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 16306a6 ("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: 16306a6 ("fs/locks: always delete_block after waiting.") Reported-by: Slawomir Pryczek <slawek1211@gmail.com> Cc: Neil Brown <neilb@suse.com> Cc: stable@vger.kernel.org Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent e6abc8c commit 6aaafc4

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎fs/nfsd/nfs4state.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ find_or_allocate_block(struct nfs4_lockowner *lo, struct knfsd_fh *fh,
265265
static void
266266
free_blocked_lock(struct nfsd4_blocked_lock *nbl)
267267
{
268+
locks_delete_block(&nbl->nbl_lock);
268269
locks_release_private(&nbl->nbl_lock);
269270
kfree(nbl);
270271
}
@@ -293,7 +294,6 @@ remove_blocked_locks(struct nfs4_lockowner *lo)
293294
nbl = list_first_entry(&reaplist, struct nfsd4_blocked_lock,
294295
nbl_lru);
295296
list_del_init(&nbl->nbl_lru);
296-
locks_delete_block(&nbl->nbl_lock);
297297
free_blocked_lock(nbl);
298298
}
299299
}
@@ -4863,7 +4863,6 @@ nfs4_laundromat(struct nfsd_net *nn)
48634863
nbl = list_first_entry(&reaplist,
48644864
struct nfsd4_blocked_lock, nbl_lru);
48654865
list_del_init(&nbl->nbl_lru);
4866-
locks_delete_block(&nbl->nbl_lock);
48674866
free_blocked_lock(nbl);
48684867
}
48694868
out:

0 commit comments

Comments
 (0)