From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever III <chuck.lever@oracle.com>
Cc: Neil Brown <neilb@suse.de>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [RFC PATCH 2/3] nfsd: rework arguments to nfs4_set_delegation
Date: Thu, 14 Jul 2022 14:59:15 -0400 [thread overview]
Message-ID: <380a3ac6d07832c4c7bef84615bc5c5d47be30ac.camel@kernel.org> (raw)
In-Reply-To: <E8CCB7EF-242C-4530-96E2-ACC7B5CB3163@oracle.com>
On Thu, 2022-07-14 at 17:14 +0000, Chuck Lever III wrote:
>
>
> > On Jul 14, 2022, at 1:12 PM, Jeff Layton <jlayton@kernel.org> wrote:
> >
> > On Thu, 2022-07-14 at 16:47 +0000, Chuck Lever III wrote:
> > >
> > > > On Jul 14, 2022, at 11:28 AM, Jeff Layton <jlayton@kernel.org> wrote:
> > > >
> > > > We'll need the nfs4_open to vet the filename. Change nfs4_set_delegation
> > > > to take the same arguments are nfs4_open_delegation.
> > >
> > > ^are^as
> > >
> > > Nit: Considering that in the next patch you change the synopsis of
> > > nfs4_open_delegation again but not nfs4_set_delegation, this
> > > description causes a little whiplash.
> > >
> > >
> >
> > Yeah, I should have squashed a couple of those together. I _did_ say it
> > was an RFC. I can resend a cleaned-up version later if you want to take
> > this in.
>
> I'm interested in Neil's thoughts about this approach, but I'm
> willing to run with it unless test results show a regression.
>
>
...and there is a regression. Partial lockdep pop here:
Jul 14 14:46:54 quad3 kernel: ============================================
Jul 14 14:46:54 quad3 kernel: WARNING: possible recursive locking detected
Jul 14 14:46:54 quad3 kernel: 5.19.0-rc5+ #316 Tainted: G OE
Jul 14 14:46:54 quad3 kernel: --------------------------------------------
Jul 14 14:46:54 quad3 kernel: nfsd/1148 is trying to acquire lock:
Jul 14 14:46:54 quad3 kernel: ffff88812a3a7388 (&inode->i_sb->s_type->i_mutex_dir_key/1){++++}-{3:3}, at: nfsd4_process_open2+0x1890/0x2710 [nfsd]
Jul 14 14:46:54 quad3 kernel:
but task is already holding lock:
Jul 14 14:46:54 quad3 kernel: ffff88812a3a7388 (&inode->i_sb->s_type->i_mutex_dir_key/1){++++}-{3:3}, at: nfsd_lookup_dentry+0x16f/0x6a0 [nfsd]
Jul 14 14:46:54 quad3 kernel:
other info that might help us debug this:
Jul 14 14:46:54 quad3 kernel: Possible unsafe locking scenario:
Jul 14 14:46:54 quad3 kernel: CPU0
Jul 14 14:46:54 quad3 kernel: ----
Jul 14 14:46:54 quad3 kernel: lock(&inode->i_sb->s_type->i_mutex_dir_key/1);
Jul 14 14:46:54 quad3 kernel: lock(&inode->i_sb->s_type->i_mutex_dir_key/1);
Jul 14 14:46:54 quad3 kernel:
*** DEADLOCK ***
Jul 14 14:46:54 quad3 kernel: May be due to missing lock nesting notation
Jul 14 14:46:54 quad3 kernel: 1 lock held by nfsd/1148:
Jul 14 14:46:54 quad3 kernel: #0: ffff88812a3a7388 (&inode->i_sb->s_type->i_mutex_dir_key/1){++++}-{3:3}, at: nfsd_lookup_dentry+0x16f/0x6a0 [nfsd]
Jul 14 14:46:54 quad3 kernel:
The core problem is the unclear locking in nfsd_lookup_dentry. Sometimes
that returns with the i_rwsem held, but there's no clear indication of
whether that's the case when the function returns. I guess fh_unlock
just takes care of that (which is a little scary, tbqh).
Now that I've taken a stab at it, I don't see how we can fix this w/o
taking Neil's locking cleanups series first. I think I'll pull that in
and try to redo this series on top of it.
Cheers,
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2022-07-14 18:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 15:28 [RFC PATCH 0/3] nfsd: close potential race between open and setting delegation Jeff Layton
2022-07-14 15:28 ` [RFC PATCH 1/3] nfsd: drop fh argument from alloc_init_deleg Jeff Layton
2022-07-14 15:28 ` [RFC PATCH 2/3] nfsd: rework arguments to nfs4_set_delegation Jeff Layton
2022-07-14 16:47 ` Chuck Lever III
2022-07-14 17:12 ` Jeff Layton
2022-07-14 17:14 ` Chuck Lever III
2022-07-14 18:59 ` Jeff Layton [this message]
2022-07-14 15:28 ` [RFC PATCH 3/3] nfsd: vet the opened dentry after setting a delegation Jeff Layton
2022-07-14 16:53 ` Chuck Lever III
2022-07-14 17:11 ` Jeff Layton
2022-07-14 17:16 ` Chuck Lever III
2022-07-14 18:49 ` Jeff Layton
2022-07-18 21:18 ` [RFC PATCH 0/3] nfsd: close potential race between open and setting delegation J. Bruce Fields
2022-07-18 21:43 ` 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=380a3ac6d07832c4c7bef84615bc5c5d47be30ac.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
/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