From: Eric Biggers <ebiggers@kernel.org>
To: Matthew Wilcox <willy@infradead.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 13:25:18 -0800 [thread overview]
Message-ID: <Ya/RPpR3AdGAFtqX@sol.localdomain> (raw)
In-Reply-To: <Ya9e9XlMPUyQUvxp@casper.infradead.org>
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;
- Eric
next prev parent reply other threads:[~2021-12-07 21:25 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 [this message]
2021-12-07 22:11 ` Matthew Wilcox
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/RPpR3AdGAFtqX@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=cgel.zte@gmail.com \
--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=willy@infradead.org \
--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).