All of lore.kernel.org
 help / color / mirror / Atom feed
* [kdave-btrfs-devel:ext/dv/fscrypt 32/43] fs/btrfs/fscrypt.c:240:34: sparse: sparse: incorrect type in return expression (different base types)
@ 2026-05-14  1:50 kernel test robot
  2026-05-14 15:53 ` Daniel Vacek
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2026-05-14  1:50 UTC (permalink / raw)
  To: Josef Bacik; +Cc: oe-kbuild-all, David Sterba, Daniel Vacek

tree:   https://github.com/kdave/btrfs-devel.git ext/dv/fscrypt
head:   4c05f02641d57f578a685f7e8d27b9cb18d17cc7
commit: fda37caa264ff597b0fc03039dc95e392432bbc5 [32/43] btrfs: implement process_bio cb for fscrypt
config: alpha-randconfig-r122-20260514 (https://download.01.org/0day-ci/archive/20260514/202605140957.DjseWRNF-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 8.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260514/202605140957.DjseWRNF-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605140957.DjseWRNF-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> fs/btrfs/fscrypt.c:240:34: sparse: sparse: incorrect type in return expression (different base types) @@     expected restricted blk_status_t @@     got int @@
   fs/btrfs/fscrypt.c:240:34: sparse:     expected restricted blk_status_t
   fs/btrfs/fscrypt.c:240:34: sparse:     got int

vim +240 fs/btrfs/fscrypt.c

   215	
   216	static blk_status_t btrfs_process_encrypted_bio(struct bio *orig_bio,
   217							struct bio *enc_bio)
   218	{
   219		struct btrfs_bio *bbio;
   220	
   221		/*
   222		 * If our bio is from the normal fs_bio_set then we know this is a
   223		 * mirror split and we can skip it, we'll get the real bio on the last
   224		 * mirror and we can process that one.
   225		 */
   226		if (orig_bio->bi_pool == &fs_bio_set)
   227			return BLK_STS_OK;
   228	
   229		bbio = btrfs_bio(orig_bio);
   230	
   231		if (bio_op(orig_bio) == REQ_OP_READ) {
   232			/*
   233			 * We have ->saved_iter based on the orig_bio, so if the block
   234			 * layer changes we need to notice this asap so we can update
   235			 * our code to handle the new world order.
   236			 */
   237			ASSERT(orig_bio == enc_bio);
   238			return btrfs_check_encrypted_read_bio(bbio, enc_bio);
   239		}
 > 240		return btrfs_csum_one_bio(bbio, enc_bio, false);
   241	}
   242	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [kdave-btrfs-devel:ext/dv/fscrypt 32/43] fs/btrfs/fscrypt.c:240:34: sparse: sparse: incorrect type in return expression (different base types)
  2026-05-14  1:50 [kdave-btrfs-devel:ext/dv/fscrypt 32/43] fs/btrfs/fscrypt.c:240:34: sparse: sparse: incorrect type in return expression (different base types) kernel test robot
@ 2026-05-14 15:53 ` Daniel Vacek
  2026-05-15 15:04   ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vacek @ 2026-05-14 15:53 UTC (permalink / raw)
  To: kernel test robot; +Cc: Josef Bacik, oe-kbuild-all, David Sterba

On Thu, 14 May 2026 at 03:51, kernel test robot <lkp@intel.com> wrote:
>
> tree:   https://github.com/kdave/btrfs-devel.git ext/dv/fscrypt
> head:   4c05f02641d57f578a685f7e8d27b9cb18d17cc7
> commit: fda37caa264ff597b0fc03039dc95e392432bbc5 [32/43] btrfs: implement process_bio cb for fscrypt
> config: alpha-randconfig-r122-20260514 (https://download.01.org/0day-ci/archive/20260514/202605140957.DjseWRNF-lkp@intel.com/config)
> compiler: alpha-linux-gcc (GCC) 8.5.0
> sparse: v0.6.5-rc1
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260514/202605140957.DjseWRNF-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@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202605140957.DjseWRNF-lkp@intel.com/
>
> sparse warnings: (new ones prefixed by >>)
> >> fs/btrfs/fscrypt.c:240:34: sparse: sparse: incorrect type in return expression (different base types) @@     expected restricted blk_status_t @@     got int @@
>    fs/btrfs/fscrypt.c:240:34: sparse:     expected restricted blk_status_t
>    fs/btrfs/fscrypt.c:240:34: sparse:     got int

@@ -238,7 +238,7 @@ static blk_status_t
btrfs_process_encrypted_bio(struct bio *orig_bio,
         ASSERT(orig_bio == enc_bio);
         return btrfs_check_encrypted_read_bio(bbio, enc_bio);
     }
-    return btrfs_csum_one_bio(bbio, enc_bio, false);
+    return btrfs_csum_one_bio(bbio, enc_bio, false)? BLK_STS_IOERR: BLK_STS_OK;
 }

This should do the trick.

--nX

>
> vim +240 fs/btrfs/fscrypt.c
>
>    215
>    216  static blk_status_t btrfs_process_encrypted_bio(struct bio *orig_bio,
>    217                                                  struct bio *enc_bio)
>    218  {
>    219          struct btrfs_bio *bbio;
>    220
>    221          /*
>    222           * If our bio is from the normal fs_bio_set then we know this is a
>    223           * mirror split and we can skip it, we'll get the real bio on the last
>    224           * mirror and we can process that one.
>    225           */
>    226          if (orig_bio->bi_pool == &fs_bio_set)
>    227                  return BLK_STS_OK;
>    228
>    229          bbio = btrfs_bio(orig_bio);
>    230
>    231          if (bio_op(orig_bio) == REQ_OP_READ) {
>    232                  /*
>    233                   * We have ->saved_iter based on the orig_bio, so if the block
>    234                   * layer changes we need to notice this asap so we can update
>    235                   * our code to handle the new world order.
>    236                   */
>    237                  ASSERT(orig_bio == enc_bio);
>    238                  return btrfs_check_encrypted_read_bio(bbio, enc_bio);
>    239          }
>  > 240          return btrfs_csum_one_bio(bbio, enc_bio, false);
>    241  }
>    242
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [kdave-btrfs-devel:ext/dv/fscrypt 32/43] fs/btrfs/fscrypt.c:240:34: sparse: sparse: incorrect type in return expression (different base types)
  2026-05-14 15:53 ` Daniel Vacek
@ 2026-05-15 15:04   ` David Sterba
  2026-05-18  7:16     ` Daniel Vacek
  0 siblings, 1 reply; 4+ messages in thread
From: David Sterba @ 2026-05-15 15:04 UTC (permalink / raw)
  To: Daniel Vacek; +Cc: kernel test robot, Josef Bacik, oe-kbuild-all, David Sterba

On Thu, May 14, 2026 at 05:53:48PM +0200, Daniel Vacek wrote:
> On Thu, 14 May 2026 at 03:51, kernel test robot <lkp@intel.com> wrote:
> >
> > tree:   https://github.com/kdave/btrfs-devel.git ext/dv/fscrypt
> > head:   4c05f02641d57f578a685f7e8d27b9cb18d17cc7
> > commit: fda37caa264ff597b0fc03039dc95e392432bbc5 [32/43] btrfs: implement process_bio cb for fscrypt
> > config: alpha-randconfig-r122-20260514 (https://download.01.org/0day-ci/archive/20260514/202605140957.DjseWRNF-lkp@intel.com/config)
> > compiler: alpha-linux-gcc (GCC) 8.5.0
> > sparse: v0.6.5-rc1
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260514/202605140957.DjseWRNF-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@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202605140957.DjseWRNF-lkp@intel.com/
> >
> > sparse warnings: (new ones prefixed by >>)
> > >> fs/btrfs/fscrypt.c:240:34: sparse: sparse: incorrect type in return expression (different base types) @@     expected restricted blk_status_t @@     got int @@
> >    fs/btrfs/fscrypt.c:240:34: sparse:     expected restricted blk_status_t
> >    fs/btrfs/fscrypt.c:240:34: sparse:     got int
> 
> @@ -238,7 +238,7 @@ static blk_status_t
> btrfs_process_encrypted_bio(struct bio *orig_bio,
>          ASSERT(orig_bio == enc_bio);
>          return btrfs_check_encrypted_read_bio(bbio, enc_bio);
>      }
> -    return btrfs_csum_one_bio(bbio, enc_bio, false);
> +    return btrfs_csum_one_bio(bbio, enc_bio, false)? BLK_STS_IOERR: BLK_STS_OK;
>  }
> 
> This should do the trick.

Please use errno_to_blk_status() as btrfs_csum_one_bio() can also return
-ENOMEM, which is BLK_STS_RESOURCE.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [kdave-btrfs-devel:ext/dv/fscrypt 32/43] fs/btrfs/fscrypt.c:240:34: sparse: sparse: incorrect type in return expression (different base types)
  2026-05-15 15:04   ` David Sterba
@ 2026-05-18  7:16     ` Daniel Vacek
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vacek @ 2026-05-18  7:16 UTC (permalink / raw)
  To: dsterba; +Cc: kernel test robot, Josef Bacik, oe-kbuild-all, David Sterba

On Fri, 15 May 2026 at 17:04, David Sterba <dsterba@suse.cz> wrote:
> On Thu, May 14, 2026 at 05:53:48PM +0200, Daniel Vacek wrote:
> > On Thu, 14 May 2026 at 03:51, kernel test robot <lkp@intel.com> wrote:
> > >
> > > tree:   https://github.com/kdave/btrfs-devel.git ext/dv/fscrypt
> > > head:   4c05f02641d57f578a685f7e8d27b9cb18d17cc7
> > > commit: fda37caa264ff597b0fc03039dc95e392432bbc5 [32/43] btrfs: implement process_bio cb for fscrypt
> > > config: alpha-randconfig-r122-20260514 (https://download.01.org/0day-ci/archive/20260514/202605140957.DjseWRNF-lkp@intel.com/config)
> > > compiler: alpha-linux-gcc (GCC) 8.5.0
> > > sparse: v0.6.5-rc1
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260514/202605140957.DjseWRNF-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@intel.com>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202605140957.DjseWRNF-lkp@intel.com/
> > >
> > > sparse warnings: (new ones prefixed by >>)
> > > >> fs/btrfs/fscrypt.c:240:34: sparse: sparse: incorrect type in return expression (different base types) @@     expected restricted blk_status_t @@     got int @@
> > >    fs/btrfs/fscrypt.c:240:34: sparse:     expected restricted blk_status_t
> > >    fs/btrfs/fscrypt.c:240:34: sparse:     got int
> >
> > @@ -238,7 +238,7 @@ static blk_status_t
> > btrfs_process_encrypted_bio(struct bio *orig_bio,
> >          ASSERT(orig_bio == enc_bio);
> >          return btrfs_check_encrypted_read_bio(bbio, enc_bio);
> >      }
> > -    return btrfs_csum_one_bio(bbio, enc_bio, false);
> > +    return btrfs_csum_one_bio(bbio, enc_bio, false)? BLK_STS_IOERR: BLK_STS_OK;
> >  }
> >
> > This should do the trick.
>
> Please use errno_to_blk_status() as btrfs_csum_one_bio() can also return
> -ENOMEM, which is BLK_STS_RESOURCE.

Ah, right. Will do that. Thanks.

--nX

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-18  7:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-14  1:50 [kdave-btrfs-devel:ext/dv/fscrypt 32/43] fs/btrfs/fscrypt.c:240:34: sparse: sparse: incorrect type in return expression (different base types) kernel test robot
2026-05-14 15:53 ` Daniel Vacek
2026-05-15 15:04   ` David Sterba
2026-05-18  7:16     ` Daniel Vacek

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.