From: yebin <yebin10@huawei.com>
To: <adilger.kernel@dilger.ca>, <tytso@mit.edu>,
<linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] ext4: Fix unnecessary hold lock when judge jinode in ext4_inode_attach_jinode
Date: Sat, 22 Aug 2020 17:29:43 +0800 [thread overview]
Message-ID: <5F40E587.1080002@huawei.com> (raw)
In-Reply-To: <20200822092544.2306917-1-yebin10@huawei.com>
Sorry, please ignore it.
On 2020/8/22 17:25, Ye Bin wrote:
> Signed-off-by: Ye Bin <yebin10@huawei.com>
> ---
> fs/ext4/inode.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 3a196d81f594..3504b4cec5b8 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -4100,12 +4100,11 @@ int ext4_inode_attach_jinode(struct inode *inode)
> return 0;
>
> jinode = jbd2_alloc_inode(GFP_KERNEL);
> + if (!jinode)
> + return -ENOMEM;
> +
> spin_lock(&inode->i_lock);
> if (!ei->jinode) {
> - if (!jinode) {
> - spin_unlock(&inode->i_lock);
> - return -ENOMEM;
> - }
> ei->jinode = jinode;
> jbd2_journal_init_jbd_inode(ei->jinode, inode);
> jinode = NULL;
prev parent reply other threads:[~2020-08-22 9:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-22 9:25 [PATCH] ext4: Fix unnecessary hold lock when judge jinode in ext4_inode_attach_jinode Ye Bin
2020-08-22 9:29 ` yebin [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=5F40E587.1080002@huawei.com \
--to=yebin10@huawei.com \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.