linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: cgel.zte@gmail.com
Cc: 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:17:41 +0000	[thread overview]
Message-ID: <Ya9e9XlMPUyQUvxp@casper.infradead.org> (raw)
In-Reply-To: <20211207101646.401982-1-lv.ruyi@zte.com.cn>

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?

  reply	other threads:[~2021-12-07 13:17 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 [this message]
2021-12-07 21:25   ` Eric Biggers
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=Ya9e9XlMPUyQUvxp@casper.infradead.org \
    --to=willy@infradead.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=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).