public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever III <chuck.lever@oracle.com>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 3/4] lockd: fix file selection in nlmsvc_cancel_blocked
Date: Mon, 14 Nov 2022 13:38:05 -0500	[thread overview]
Message-ID: <1e2722cee7cc03f0da0623a7d45b9531973c0906.camel@kernel.org> (raw)
In-Reply-To: <55593a438387aca9187a8a8ea1e0d3c2cc4efb9b.camel@kernel.org>

On Fri, 2022-11-11 at 16:52 -0500, Jeff Layton wrote:
> On Fri, 2022-11-11 at 20:29 +0000, Chuck Lever III wrote:
> > 
> > > On Nov 11, 2022, at 2:36 PM, Jeff Layton <jlayton@kernel.org> wrote:
> > > 
> > > We currently do a lock_to_openmode call based on the arguments from the
> > > NLM_UNLOCK call, but that will always set the fl_type of the lock to
> > > F_UNLCK, the the O_RDONLY descriptor is always chosen.
> > 
> > Except for the above sentence, these all look sane to me.
> > I can apply them to nfsd's for-next once they've seen some
> > review on fsdevel, as you mentioned in the other thread.
> > 
> > 
> 
> Thanks. That should say "and the O_RDONLY...". Fixed in my tree.
> 
> I'll go ahead and resend with fsdevel included.
> 

I reposted the series Friday afternoon.

What might be best is for you to carry the first 3 patches in the nfsd
tree, and I'll take the filelock: patch into the locks-next branch,
along with the other filelock API cleanups.

Sound OK?

> > > Fix it to use the file_lock from the block instead.
> > > 
> > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > > ---
> > > fs/lockd/svclock.c | 7 ++++---
> > > 1 file changed, 4 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
> > > index 9eae99e08e69..4e30f3c50970 100644
> > > --- a/fs/lockd/svclock.c
> > > +++ b/fs/lockd/svclock.c
> > > @@ -699,9 +699,10 @@ nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *l
> > > 	block = nlmsvc_lookup_block(file, lock);
> > > 	mutex_unlock(&file->f_mutex);
> > > 	if (block != NULL) {
> > > -		mode = lock_to_openmode(&lock->fl);
> > > -		vfs_cancel_lock(block->b_file->f_file[mode],
> > > -				&block->b_call->a_args.lock.fl);
> > > +		struct file_lock *fl = &block->b_call->a_args.lock.fl;
> > > +
> > > +		mode = lock_to_openmode(fl);
> > > +		vfs_cancel_lock(block->b_file->f_file[mode], fl);
> > > 		status = nlmsvc_unlink_block(block);
> > > 		nlmsvc_release_block(block);
> > > 	}
> > > -- 
> > > 2.38.1
> > > 
> > 
> > --
> > Chuck Lever
> > 
> > 
> > 
> 

-- 
Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2022-11-14 18:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11 19:36 [PATCH 0/4] filelock: WARN when @filp and fl_file don't match Jeff Layton
2022-11-11 19:36 ` [PATCH 1/4] lockd: set missing fl_flags field when retrieving args Jeff Layton
2022-11-11 19:36 ` [PATCH 2/4] lockd: ensure we use the correct file description when unlocking Jeff Layton
2022-11-11 19:36 ` [PATCH 3/4] lockd: fix file selection in nlmsvc_cancel_blocked Jeff Layton
2022-11-11 20:29   ` Chuck Lever III
2022-11-11 21:52     ` Jeff Layton
2022-11-14 18:38       ` Jeff Layton [this message]
2022-11-14 18:52         ` Chuck Lever III
2022-11-11 19:36 ` [PATCH 4/4] filelock: WARN_ON_ONCE when ->fl_file and filp don't match Jeff Layton
2022-11-11 19:43   ` Jeff Layton
  -- strict thread matches above, loose matches on Subject: below --
2022-11-11 21:55 [PATCH 0/4] filelock: WARN when @filp and fl_file " Jeff Layton
2022-11-11 21:55 ` [PATCH 3/4] lockd: fix file selection in nlmsvc_cancel_blocked Jeff Layton

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=1e2722cee7cc03f0da0623a7d45b9531973c0906.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --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