[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20241021190220.GD24631@suse.cz>
Date: Mon, 21 Oct 2024 21:02:20 +0200
From: David Sterba <dsterba@...e.cz>
To: kernel test robot <lkp@...el.com>
Cc: Naohiro Aota <naohiro.aota@....com>, oe-kbuild-all@...ts.linux.dev,
David Sterba <dsterba@...e.com>, Qu Wenruo <wqu@...e.com>,
Christoph Hellwig <hch@....de>,
Johannes Thumshirn <johannes.thumshirn@....com>,
linux-kernel@...r.kernel.org
Subject: Re: [linux-next:master 4259/5321] fs/btrfs/bio.c:132:17: sparse:
sparse: cast from restricted blk_status_t
On Fri, Oct 18, 2024 at 01:17:15AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 7df1e7189cecb6965ce672e820a5ec6cf499b65b
> commit: c87222d18145c93b0ebd860ae9166afb1457129c [4259/5321] btrfs: fix error propagation of split bios
> config: microblaze-randconfig-r133-20241017 (https://download.01.org/0day-ci/archive/20241018/202410180159.O8S1AyaN-lkp@intel.com/config)
> compiler: microblaze-linux-gcc (GCC) 14.1.0
microblaze
> reproduce: (https://download.01.org/0day-ci/archive/20241018/202410180159.O8S1AyaN-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@...el.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202410180159.O8S1AyaN-lkp@intel.com/
>
> sparse warnings: (new ones prefixed by >>)
> >> fs/btrfs/bio.c:132:17: sparse: sparse: cast from restricted blk_status_t
> >> fs/btrfs/bio.c:132:17: sparse: sparse: cast to restricted blk_status_t
> fs/btrfs/bio.c: note: in included file (through include/linux/smp.h, include/linux/lockdep.h, include/linux/spinlock.h, ...):
> include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
>
> vim +132 fs/btrfs/bio.c
>
> 116
> 117 void btrfs_bio_end_io(struct btrfs_bio *bbio, blk_status_t status)
> 118 {
> 119 bbio->bio.bi_status = status;
> 120 if (bbio->bio.bi_pool == &btrfs_clone_bioset) {
> 121 struct btrfs_bio *orig_bbio = bbio->private;
> 122
> 123 btrfs_cleanup_bio(bbio);
> 124 bbio = orig_bbio;
> 125 }
> 126
> 127 /*
> 128 * At this point, bbio always points to the original btrfs_bio. Save
> 129 * the first error in it.
> 130 */
> 131 if (status != BLK_STS_OK)
> > 132 cmpxchg(&bbio->status, BLK_STS_OK, status);
I don't see an arch-specific implementation of cmpxchg in
arch/microblaze/ so I'm assuming it's using some fallback that's in C so
sparse detects the type mismatches. The attribute is __bitwise but it
should not matter here.
Powered by blists - more mailing lists