linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: cgel.zte@gmail.com, viro@zeniv.linux.org.uk,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lv Ruyi <lv.ruyi@zte.com.cn>, Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] fs/dcache: prevent repeated locking
Date: Tue, 7 Dec 2021 22:11:12 +0000	[thread overview]
Message-ID: <Ya/cAOtx/EoAgWOi@casper.infradead.org> (raw)
In-Reply-To: <Ya/RPpR3AdGAFtqX@sol.localdomain>

On Tue, Dec 07, 2021 at 01:25:18PM -0800, Eric Biggers wrote:
> On Tue, Dec 07, 2021 at 01:17:41PM +0000, Matthew Wilcox wrote:
> > On Tue, Dec 07, 2021 at 10:16:46AM +0000, cgel.zte@gmail.com wrote:
> > > From: Lv Ruyi <lv.ruyi@zte.com.cn>
> > > 
> > > Move the spin_lock above the restart to prevent to lock twice 
> > > when the code goto restart.
> > 
> > This is madness.
> > 
> > void d_prune_aliases(struct inode *inode)
> >         spin_lock(&inode->i_lock);
> >                         if (likely(!dentry->d_lockref.count)) {
> >                                 __dentry_kill(dentry);
> >                                 goto restart;
> > ...
> > static void __dentry_kill(struct dentry *dentry)
> >         if (dentry->d_inode)
> >                 dentry_unlink_inode(dentry);
> > ...
> > static void dentry_unlink_inode(struct dentry * dentry)
> >         spin_unlock(&inode->i_lock);
> > 
> > Did you even test this patch?
> 
> This same wrong patch has been sent several times before.  I think it's fair to
> say that this code could use a comment, e.g.:
> 
> 	/* i_lock was dropped */
> 	goto restart;

Not sure that'll do much good.  It seems to be fools running some script
that they haven't the wit to understand.

      reply	other threads:[~2021-12-07 22:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07 10:16 [PATCH] fs/dcache: prevent repeated locking cgel.zte
2021-12-07 13:17 ` Matthew Wilcox
2021-12-07 21:25   ` Eric Biggers
2021-12-07 22:11     ` Matthew Wilcox [this message]

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=Ya/cAOtx/EoAgWOi@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=cgel.zte@gmail.com \
    --cc=ebiggers@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.ruyi@zte.com.cn \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zealci@zte.com.cn \
    /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).