Re: [PATCH 2/2] scsi: target: iblock: Report space allocation errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Konstantin,

kernel test robot noticed the following build warnings:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on linus/master v6.4-rc3]
[cannot apply to next-20230525]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Konstantin-Shelekhin/scsi-target-core-Add-sense-reason-for-space-allocation-errors/20230517-221755
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
patch link:    https://lore.kernel.org/r/20230517141537.80936-3-k.shelekhin%40yadro.com
patch subject: [PATCH 2/2] scsi: target: iblock: Report space allocation errors
config: sparc-randconfig-s043-20230517 (https://download.01.org/0day-ci/archive/20230528/202305280314.CoHoeIlx-lkp@xxxxxxxxx/config)
compiler: sparc-linux-gcc (GCC) 12.1.0
reproduce:
        mkdir -p ~/bin
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/a1c912b7cd68155b131113eae148f7f79ef93676
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Konstantin-Shelekhin/scsi-target-core-Add-sense-reason-for-space-allocation-errors/20230517-221755
        git checkout a1c912b7cd68155b131113eae148f7f79ef93676
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 ~/bin/make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sparc olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 ~/bin/make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sparc SHELL=/bin/bash drivers/target/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305280314.CoHoeIlx-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/target/target_core_iblock.c:333:57: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected restricted blk_status_t [usertype] status @@     got int @@
   drivers/target/target_core_iblock.c:333:57: sparse:     expected restricted blk_status_t [usertype] status
   drivers/target/target_core_iblock.c:333:57: sparse:     got int
>> drivers/target/target_core_iblock.c:354:61: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected int new @@     got restricted blk_status_t [usertype] bi_status @@
   drivers/target/target_core_iblock.c:354:61: sparse:     expected int new
   drivers/target/target_core_iblock.c:354:61: sparse:     got restricted blk_status_t [usertype] bi_status

vim +333 drivers/target/target_core_iblock.c

   324	
   325	static void iblock_complete_cmd(struct se_cmd *cmd)
   326	{
   327		struct iblock_req *ibr = cmd->priv;
   328		sense_reason_t reason;
   329	
   330		if (!refcount_dec_and_test(&ibr->pending))
   331			return;
   332	
 > 333		reason = iblock_blk_status_to_reason(atomic_read(&ibr->status));
   334	
   335		if (reason == TCM_NO_SENSE)
   336			target_complete_cmd(cmd, SAM_STAT_GOOD);
   337		else
   338			target_complete_cmd_with_sense(cmd, SAM_STAT_CHECK_CONDITION, reason);
   339	
   340		kfree(ibr);
   341	}
   342	
   343	static void iblock_bio_done(struct bio *bio)
   344	{
   345		struct se_cmd *cmd = bio->bi_private;
   346		struct iblock_req *ibr = cmd->priv;
   347	
   348		if (bio->bi_status) {
   349			pr_err("bio error: %p,  err: %d\n", bio, bio->bi_status);
   350			/*
   351			 * Set the error status of the iblock request to the error
   352			 * status of the first failed bio.
   353			 */
 > 354			atomic_cmpxchg(&ibr->status, BLK_STS_OK, bio->bi_status);
   355			smp_mb__after_atomic();
   356		}
   357	
   358		bio_put(bio);
   359	
   360		iblock_complete_cmd(cmd);
   361	}
   362	

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



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux