linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Li, Hao" <lihao2018.fnst@cn.fujitsu.com>
To: YANG LI <abaci-bugfix@linux.alibaba.com>, <viro@zeniv.linux.org.uk>
Cc: <linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs: fix: second lock in function d_prune_aliases().
Date: Wed, 30 Dec 2020 16:27:27 +0800	[thread overview]
Message-ID: <1c0dfdc1-911c-a12c-c25a-e88b082acb25@cn.fujitsu.com> (raw)
In-Reply-To: <1609311685-99562-1-git-send-email-abaci-bugfix@linux.alibaba.com>

On 2020/12/30 15:01, YANG LI wrote:
> Goto statement jumping will cause lock to be executed again without
> executing unlock, placing the lock statement in front of goto
> label to fix this problem.
>
> Signed-off-by: YANG LI <abaci-bugfix@linux.alibaba.com>
> Reported-by: Abaci <abaci@linux.alibaba.com>
> ---
>  fs/dcache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/dcache.c b/fs/dcache.c
> index 97e81a8..bf38446 100644
> --- a/fs/dcache.c
> +++ b/fs/dcache.c
> @@ -1050,6 +1050,6 @@ void d_prune_aliases(struct inode *inode)
>  {
>      struct dentry *dentry;
> -restart:
>      spin_lock(&inode->i_lock);

This inode lock should be released at __dentry_kill->dentry_unlink_inode.

Regards,
Hao Lee

>
> +restart:
>      hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
>          spin_lock(&dentry->d_lock);




  reply	other threads:[~2020-12-30  8:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30  7:01 [PATCH] fs: fix: second lock in function d_prune_aliases() YANG LI
2020-12-30  8:27 ` Li, Hao [this message]
2020-12-30 20:04 ` Al Viro
2020-12-30 21:36   ` 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=1c0dfdc1-911c-a12c-c25a-e88b082acb25@cn.fujitsu.com \
    --to=lihao2018.fnst@cn.fujitsu.com \
    --cc=abaci-bugfix@linux.alibaba.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).