All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever III <chuck.lever@oracle.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: Dai Ngo <dai.ngo@oracle.com>, Bruce Fields <bfields@fieldses.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH RFC 2/3] fs/lock: only call lm_breaker_owns_lease if there is conflict.
Date: Thu, 3 Feb 2022 19:32:09 +0000	[thread overview]
Message-ID: <7CA3D081-8AC4-4B24-849C-7840457D18F8@oracle.com> (raw)
In-Reply-To: <1643398773-29149-3-git-send-email-dai.ngo@oracle.com>

Hi Jeff-

> On Jan 28, 2022, at 2:39 PM, Dai Ngo <dai.ngo@oracle.com> wrote:
> 
> Modify leases_conflict to call lm_breaker_owns_lease only if
> there is real conflict.  This is to allow the lock manager to
> resolve the conflict if possible.
> 
> Signed-off-by: Dai Ngo <dai.ngo@oracle.com>

If we are to take 1/3 and 2/3 through the nfsd tree,
can you send an Acked-by: ?


> ---
> fs/locks.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/locks.c b/fs/locks.c
> index 052b42cc7f25..456717873cff 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -1357,9 +1357,6 @@ static bool leases_conflict(struct file_lock *lease, struct file_lock *breaker)
> {
> 	bool rc;
> 
> -	if (lease->fl_lmops->lm_breaker_owns_lease
> -			&& lease->fl_lmops->lm_breaker_owns_lease(lease))
> -		return false;
> 	if ((breaker->fl_flags & FL_LAYOUT) != (lease->fl_flags & FL_LAYOUT)) {
> 		rc = false;
> 		goto trace;
> @@ -1370,6 +1367,9 @@ static bool leases_conflict(struct file_lock *lease, struct file_lock *breaker)
> 	}
> 
> 	rc = locks_conflict(breaker, lease);
> +	if (rc && lease->fl_lmops->lm_breaker_owns_lease &&
> +		lease->fl_lmops->lm_breaker_owns_lease(lease))
> +		rc = false;
> trace:
> 	trace_leases_conflict(rc, lease, breaker);
> 	return rc;
> -- 
> 2.9.5
> 

--
Chuck Lever




  reply	other threads:[~2022-02-03 19:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 19:39 [PATCH RFC v10 0/3] nfsd: Initial implementation of NFSv4 Courteous Server Dai Ngo
2022-01-28 19:39 ` [PATCH RFC 1/3] fs/lock: add new callback, lm_expire_lock, to lock_manager_operations Dai Ngo
2022-02-03 18:41   ` Chuck Lever III
2022-02-03 21:38     ` dai.ngo
2022-02-03 22:50   ` Jeff Layton
2022-02-03 23:13     ` dai.ngo
2022-01-28 19:39 ` [PATCH RFC 2/3] fs/lock: only call lm_breaker_owns_lease if there is conflict Dai Ngo
2022-02-03 19:32   ` Chuck Lever III [this message]
2022-02-03 22:51   ` Jeff Layton
2022-01-28 19:39 ` [PATCH RFC 3/3] nfsd: Initial implementation of NFSv4 Courteous Server Dai Ngo
2022-02-03 19:31   ` Chuck Lever III
2022-02-03 21:38     ` dai.ngo
2022-02-03 23:40       ` Chuck Lever III
2022-02-04  3:42         ` dai.ngo
2022-02-04 15:25           ` Chuck Lever III
2022-02-04 17:02             ` dai.ngo
2022-02-04 17:09               ` Chuck Lever III
2022-02-06 19:04 [PATCH RFC v10 0/3] " Dai Ngo
2022-02-06 19:04 ` [PATCH RFC 2/3] fs/lock: only call lm_breaker_owns_lease if there is conflict Dai Ngo

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=7CA3D081-8AC4-4B24-849C-7840457D18F8@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=bfields@fieldses.org \
    --cc=dai.ngo@oracle.com \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.