From: Benjamin Coddington <bcodding@redhat.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: Alexander Aring <aahringo@redhat.com>,
linux-nfs@vger.kernel.org, ocfs2-devel@lists.linux.dev,
linux-fsdevel@vger.kernel.org, teigland@redhat.com,
rpeterso@redhat.com, agruenba@redhat.com,
trond.myklebust@hammerspace.com, anna@kernel.org,
chuck.lever@oracle.com
Subject: Re: [PATCH 1/7] lockd: introduce safe async lock op
Date: Tue, 10 Sep 2024 12:56:13 -0400 [thread overview]
Message-ID: <C158604C-DD07-49C9-8C7B-A9807CD71473@redhat.com> (raw)
In-Reply-To: <1490adc3ae3f82968c6112bb6f9df3c3f2229b04.camel@kernel.org>
On 10 Sep 2024, at 11:45, Jeff Layton wrote:
> On Tue, 2024-09-10 at 10:18 -0400, Benjamin Coddington wrote:
>> On 23 Aug 2023, at 17:33, Alexander Aring wrote:
>>
>>> This patch reverts mostly commit 40595cdc93ed ("nfs: block notification
>>> on fs with its own ->lock") and introduces an EXPORT_OP_SAFE_ASYNC_LOCK
>>> export flag to signal that the "own ->lock" implementation supports
>>> async lock requests. The only main user is DLM that is used by GFS2 and
>>> OCFS2 filesystem. Those implement their own lock() implementation and
>>> return FILE_LOCK_DEFERRED as return value. Since commit 40595cdc93ed
>>> ("nfs: block notification on fs with its own ->lock") the DLM
>>> implementation were never updated. This patch should prepare for DLM
>>> to set the EXPORT_OP_SAFE_ASYNC_LOCK export flag and update the DLM
>>> plock implementation regarding to it.
>>>
>>> Acked-by: Jeff Layton <jlayton@kernel.org>
>>> Signed-off-by: Alexander Aring <aahringo@redhat.com>
>>> ---
>>> fs/lockd/svclock.c | 5 ++---
>>> fs/nfsd/nfs4state.c | 13 ++++++++++---
>>> include/linux/exportfs.h | 8 ++++++++
>>> 3 files changed, 20 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
>>> index c43ccdf28ed9..6e3b230e8317 100644
>>> --- a/fs/lockd/svclock.c
>>> +++ b/fs/lockd/svclock.c
>>> @@ -470,9 +470,7 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
>>> struct nlm_host *host, struct nlm_lock *lock, int wait,
>>> struct nlm_cookie *cookie, int reclaim)
>>> {
>>> -#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
>>> struct inode *inode = nlmsvc_file_inode(file);
>>> -#endif
>>> struct nlm_block *block = NULL;
>>> int error;
>>> int mode;
>>> @@ -486,7 +484,8 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
>>> (long long)lock->fl.fl_end,
>>> wait);
>>>
>>> - if (nlmsvc_file_file(file)->f_op->lock) {
>>> + if (!export_op_support_safe_async_lock(inode->i_sb->s_export_op,
>>> + nlmsvc_file_file(file)->f_op)) {
>>
>> ... but don't most filesystem use VFS' posix_lock_file(), which does the
>> right thing? I think this patch has broken async lock callbacks for NLM for
>> all the other filesystems that just use posix_lock_file().
>>
>> Maybe I'm missing something, but why was that necessary?
>>
>
> Good catch. Yeah, I think that probably should have been an &&
> condition. IOW:
>
> if (nlmsvc_file_file(file)->f_op->lock &&
> !export_op_support_safe_async_lock(inode->i_sb->s_export_op,
>
Ah Jeff, thanks for confirming - there's been a bunch of changes in there that
made me uncertain. I can send a patch for this, I'd like to rename
export_op_support_safe_async_lock to something like fs_can_defer_lock
(suggestions) and put the test in there.
Ben
next prev parent reply other threads:[~2024-09-10 16:56 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 21:33 [PATCH 0/7] lockd: dlm: async lock request changes Alexander Aring
2023-08-23 21:33 ` [PATCH 1/7] lockd: introduce safe async lock op Alexander Aring
2023-08-25 17:21 ` Chuck Lever
2023-08-30 12:32 ` Alexander Aring
2023-08-30 13:45 ` Chuck Lever
2023-08-25 18:14 ` Jeff Layton
2024-09-10 14:18 ` Benjamin Coddington
2024-09-10 15:45 ` Jeff Layton
2024-09-10 16:56 ` Benjamin Coddington [this message]
2024-09-10 17:17 ` Alexander Aring
2024-09-11 13:24 ` Jeff Layton
2024-09-11 14:35 ` Benjamin Coddington
2024-09-10 17:13 ` Alexander Aring
2023-08-23 21:33 ` [PATCH 2/7] lockd: don't call vfs_lock_file() for pending requests Alexander Aring
2023-08-25 18:10 ` Jeff Layton
2023-08-30 12:15 ` Alexander Aring
2023-08-23 21:33 ` [PATCH 3/7] lockd: fix race in async lock request handling Alexander Aring
2023-08-25 17:35 ` Chuck Lever
2023-08-25 18:16 ` Jeff Layton
2023-08-23 21:33 ` [PATCH 4/7] lockd: add doc to enable EXPORT_OP_SAFE_ASYNC_LOCK Alexander Aring
2023-08-25 18:17 ` Jeff Layton
2023-08-23 21:33 ` [PATCH 5/7] dlm: use fl_owner from lockd Alexander Aring
2023-08-23 21:33 ` [PATCH 6/7] dlm: use FL_SLEEP to determine blocking vs non-blocking Alexander Aring
2023-08-25 18:18 ` Jeff Layton
2023-08-30 12:38 ` Alexander Aring
2023-08-30 13:46 ` Jeff Layton
2023-08-23 21:33 ` [PATCH 7/7] dlm: implement EXPORT_OP_SAFE_ASYNC_LOCK Alexander Aring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C158604C-DD07-49C9-8C7B-A9807CD71473@redhat.com \
--to=bcodding@redhat.com \
--cc=aahringo@redhat.com \
--cc=agruenba@redhat.com \
--cc=anna@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=ocfs2-devel@lists.linux.dev \
--cc=rpeterso@redhat.com \
--cc=teigland@redhat.com \
--cc=trond.myklebust@hammerspace.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).