mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Yue Haibing <yuehaibing@huawei.com>
Cc: clm@fb.com, josef@toxicpanda.com, Johannes.Thumshirn@wdc.com,
	dsterba@suse.com, mpdesouza@suse.com, gniebler@suse.com,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: Fix passing 0 to ERR_PTR in btrfs_search_dir_index_item()
Date: Tue, 22 Oct 2024 15:48:22 +0200	[thread overview]
Message-ID: <20241022134821.GC31418@suse.cz> (raw)
In-Reply-To: <20241022095208.1369473-1-yuehaibing@huawei.com>

On Tue, Oct 22, 2024 at 05:52:08PM +0800, Yue Haibing wrote:
> ret may be zero in btrfs_search_dir_index_item() and should not passed
> to ERR_PTR(). Now btrfs_unlink_subvol() is the only caller to this,
> reconstructed it to check ERR_PTR(-ENOENT) while ret >= 0, this fix
> smatch warnings:
> 
> fs/btrfs/dir-item.c:353
>  btrfs_search_dir_index_item() warn: passing zero to 'ERR_PTR'
> 
> Fixes: 9dcbe16fccbb ("btrfs: use btrfs_for_each_slot in btrfs_search_dir_index_item")
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
> ---
> v2: return ERR_PTR(-ENOENT) while ret >= 0

Reviewed-by: David Sterba <dsterba@suse.com>

Added to for-next, thanks.

      parent reply	other threads:[~2024-10-22 13:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22  9:52 Yue Haibing
2024-10-22  9:56 ` Johannes Thumshirn
2024-10-22 13:48 ` David Sterba [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=20241022134821.GC31418@suse.cz \
    --to=dsterba@suse.cz \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=gniebler@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpdesouza@suse.com \
    --cc=yuehaibing@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®