Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: oe-kbuild@lists.linux.dev, Qu Wenruo <wqu@suse.com>,
	linux-btrfs@vger.kernel.org, lkp@intel.com,
	oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH 2/4] btrfs: make btrfs_repair_io_failure() handle bs > ps cases without large folios
Date: Fri, 3 Oct 2025 13:53:46 +0300	[thread overview]
Message-ID: <aN-rOq9boL0hXZ3R@stanley.mountain> (raw)
In-Reply-To: <234df03b-e6fc-44c8-a28f-aa51305d87a0@gmx.com>

On Fri, Oct 03, 2025 at 06:47:11PM +0930, Qu Wenruo wrote:
> > cc53bd2085c8fa David Sterba      2025-09-17  885  	if (unlikely(!smap.dev->bdev ||
> > cc53bd2085c8fa David Sterba      2025-09-17  886  		     !test_bit(BTRFS_DEV_STATE_WRITEABLE, &smap.dev->dev_state))) {
> > bacf60e5158629 Christoph Hellwig 2022-11-15  887  		ret = -EIO;
> > bacf60e5158629 Christoph Hellwig 2022-11-15  888  		goto out_counter_dec;
> > bacf60e5158629 Christoph Hellwig 2022-11-15  889  	}
> > bacf60e5158629 Christoph Hellwig 2022-11-15  890
> > 2d65a91734a195 Qu Wenruo         2025-10-01  891  	bio = bio_alloc(smap.dev->bdev, nr_steps, REQ_OP_WRITE | REQ_SYNC, GFP_NOFS);
> > 2d65a91734a195 Qu Wenruo         2025-10-01  892  	/* Backed by fs_bio_set, shouldn't fail. */
> > 2d65a91734a195 Qu Wenruo         2025-10-01  893  	ASSERT(bio);
> > 2d65a91734a195 Qu Wenruo         2025-10-01 @894  	bio->bi_iter.bi_sector = smap.physical >> SECTOR_SHIFT;
> 
> I have no idea how to make smatch happy.

I would just delete the unnecessary NULL check, but an equally valid
thing is to just ignore the warning.  In the kernel, all old warnings
are false positives.  I'm never aiming for being completely free from
static checker warnings because that means we have to be less ambitious
about what we check for.

regards,
dan carpenter



  reply	other threads:[~2025-10-03 10:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-01  9:50 [PATCH 0/4] btrfs: enable encoded read/write/send for bs > ps cases Qu Wenruo
2025-10-01  9:50 ` [PATCH 1/4] btrfs: make btrfs_csum_one_bio() handle bs > ps without large folios Qu Wenruo
2025-10-01  9:50 ` [PATCH 2/4] btrfs: make btrfs_repair_io_failure() handle bs > ps cases " Qu Wenruo
2025-10-02 16:46   ` kernel test robot
2025-10-03  7:58   ` Dan Carpenter
2025-10-03  9:17     ` Qu Wenruo
2025-10-03 10:53       ` Dan Carpenter [this message]
2025-10-03 21:18         ` Qu Wenruo
2025-10-01  9:50 ` [PATCH 3/4] btrfs: make read verification " Qu Wenruo
2025-10-01  9:50 ` [PATCH 4/4] btrfs: enable encoded read/write/send for bs > ps cases Qu Wenruo

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=aN-rOq9boL0hXZ3R@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.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