From: Dan Carpenter <dan.carpenter@linaro.org>
To: Li Zetao <lizetao1@huawei.com>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH next] btrfs: Fix reversed condition in copy_inline_to_page()
Date: Wed, 28 Aug 2024 16:13:21 +0300 [thread overview]
Message-ID: <5a19b8a7-385c-4616-a5b7-212e19c9ddc1@stanley.mountain> (raw)
In-Reply-To: <40421bdb-4573-4768-8d6d-39b0d0df9260@huawei.com>
On Wed, Aug 28, 2024 at 08:53:44PM +0800, Li Zetao wrote:
> Hi Dan,
>
> 在 2024/8/27 18:21, Dan Carpenter 写道:
> > This if statement is reversed leading to locking issues.
> >
> > Fixes: 8e603cfe05f0 ("btrfs: convert copy_inline_to_page() to use folio")
> > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > ---
> > This patch is obviously correct but it's from static analysis so additional
> > testing would be good as well.
> >
> > fs/btrfs/reflink.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c
> > index 1681d63f03dd..f0824c948cb7 100644
> > --- a/fs/btrfs/reflink.c
> > +++ b/fs/btrfs/reflink.c
> > @@ -146,7 +146,7 @@ static int copy_inline_to_page(struct btrfs_inode *inode,
> > btrfs_folio_clear_checked(fs_info, folio, file_offset, block_size);
> > btrfs_folio_set_dirty(fs_info, folio, file_offset, block_size);
> > out_unlock:
> > - if (IS_ERR(folio)) {
> > + if (!IS_ERR(folio)) {
> This is a mistake caused by my carelessness,thank you for the patch
> > folio_unlock(folio);
> > folio_put(folio);
> > }
>
> Can I merge your patch into my patchset and add you as a co-author?
Just merge it. No need for co-author credit for something tiny like this. :P
regards,
dan carpenter
prev parent reply other threads:[~2024-08-28 13:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 10:21 Dan Carpenter
2024-08-27 15:37 ` David Sterba
2024-08-28 12:53 ` Li Zetao
2024-08-28 13:13 ` Dan Carpenter [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=5a19b8a7-385c-4616-a5b7-212e19c9ddc1@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizetao1@huawei.com \
/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
all inboxes | Powered by JetHome®