linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Alexander Aring <aahringo@redhat.com>, linux-nfs@vger.kernel.org
Cc: cluster-devel@redhat.com, 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 4/7] lockd: add doc to enable EXPORT_OP_SAFE_ASYNC_LOCK
Date: Fri, 25 Aug 2023 14:17:38 -0400	[thread overview]
Message-ID: <66276fa17fbe7c9db536b636f5316b6b3a6d9829.camel@kernel.org> (raw)
In-Reply-To: <20230823213352.1971009-5-aahringo@redhat.com>

On Wed, 2023-08-23 at 17:33 -0400, Alexander Aring wrote:
> This patch adds a note to enable EXPORT_OP_SAFE_ASYNC_LOCK for
> asynchronous lock request handling.
> 
> Signed-off-by: Alexander Aring <aahringo@redhat.com>
> ---
>  fs/locks.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/locks.c b/fs/locks.c
> index df8b26a42524..edee02d1ca93 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -2255,11 +2255,13 @@ int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock *flock)
>   * To avoid blocking kernel daemons, such as lockd, that need to acquire POSIX
>   * locks, the ->lock() interface may return asynchronously, before the lock has
>   * been granted or denied by the underlying filesystem, if (and only if)
> - * lm_grant is set. Callers expecting ->lock() to return asynchronously
> - * will only use F_SETLK, not F_SETLKW; they will set FL_SLEEP if (and only if)
> - * the request is for a blocking lock. When ->lock() does return asynchronously,
> - * it must return FILE_LOCK_DEFERRED, and call ->lm_grant() when the lock
> - * request completes.
> + * lm_grant is set. Additionally EXPORT_OP_SAFE_ASYNC_LOCK in export_operations
> + * flags need to be set.
> + *
> + * Callers expecting ->lock() to return asynchronously will only use F_SETLK,
> + * not F_SETLKW; they will set FL_SLEEP if (and only if) the request is for a
> + * blocking lock. When ->lock() does return asynchronously, it must return
> + * FILE_LOCK_DEFERRED, and call ->lm_grant() when the lock request completes.
>   * If the request is for non-blocking lock the file system should return
>   * FILE_LOCK_DEFERRED then try to get the lock and call the callback routine
>   * with the result. If the request timed out the callback routine will return a

Reviewed-by: Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2023-08-25 18:18 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
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 [this message]
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=66276fa17fbe7c9db536b636f5316b6b3a6d9829.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=aahringo@redhat.com \
    --cc=agruenba@redhat.com \
    --cc=anna@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=cluster-devel@redhat.com \
    --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).