lockd: don't call vfs_lock_file() for pending requests
authorAlexander Aring <aahringo@redhat.com>
Tue, 12 Sep 2023 21:53:19 +0000 (17:53 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 16 Oct 2023 16:44:01 +0000 (12:44 -0400)
commitb743612c0aaa49a781f1f0c760e35d7298b5c5b4
treefec5a252d5a8c13040fd0a8921577b5dff74a815
parent2dd10de8e6bcbacf85ad758b904543c294820c63
lockd: don't call vfs_lock_file() for pending requests

This patch returns nlm_lck_blocked in nlmsvc_lock() when an asynchronous
lock request is pending. During testing I ran into the case with the
side-effects that lockd is waiting for only one lm_grant() callback
because it's already part of the nlm_blocked list. If another
asynchronous for the same nlm_block is triggered two lm_grant()
callbacks will occur but lockd was only waiting for one.

To avoid any change of existing users this handling will only being made
when export_op_support_safe_async_lock() returns true.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/svclock.c