Re: [PATCH] block: remove more NULL checks after bdev_get_queue()

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

 



Hi Juhyung,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on axboe-block/for-next]
[also build test WARNING on linus/master v6.2-rc6 next-20230202]
[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/Juhyung-Park/block-remove-more-NULL-checks-after-bdev_get_queue/20230202-171443
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
patch link:    https://lore.kernel.org/r/20230202091151.855784-1-qkrwngud825%40gmail.com
patch subject: [PATCH] block: remove more NULL checks after bdev_get_queue()
config: x86_64-rhel-8.3-func (https://download.01.org/0day-ci/archive/20230203/202302030733.TVNhMvP4-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/f62253701c6bf771227300ca8c572c778c2670bb
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Juhyung-Park/block-remove-more-NULL-checks-after-bdev_get_queue/20230202-171443
        git checkout f62253701c6bf771227300ca8c572c778c2670bb
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 olddefconfig
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   block/blk-zoned.c: In function 'blkdev_report_zones_ioctl':
>> block/blk-zoned.c:337:31: warning: variable 'q' set but not used [-Wunused-but-set-variable]
     337 |         struct request_queue *q;
         |                               ^
   block/blk-zoned.c: In function 'blkdev_zone_mgmt_ioctl':
   block/blk-zoned.c:392:31: warning: variable 'q' set but not used [-Wunused-but-set-variable]
     392 |         struct request_queue *q;
         |                               ^


vim +/q +337 block/blk-zoned.c

d41003513e61dd Christoph Hellwig 2019-11-11  327  
56c4bddb970658 Bart Van Assche   2018-03-08  328  /*
3ed05a987e0f63 Shaun Tancheff    2016-10-18  329   * BLKREPORTZONE ioctl processing.
3ed05a987e0f63 Shaun Tancheff    2016-10-18  330   * Called from blkdev_ioctl.
3ed05a987e0f63 Shaun Tancheff    2016-10-18  331   */
3ed05a987e0f63 Shaun Tancheff    2016-10-18  332  int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode,
3ed05a987e0f63 Shaun Tancheff    2016-10-18  333  			      unsigned int cmd, unsigned long arg)
3ed05a987e0f63 Shaun Tancheff    2016-10-18  334  {
3ed05a987e0f63 Shaun Tancheff    2016-10-18  335  	void __user *argp = (void __user *)arg;
d41003513e61dd Christoph Hellwig 2019-11-11  336  	struct zone_report_args args;
3ed05a987e0f63 Shaun Tancheff    2016-10-18 @337  	struct request_queue *q;
3ed05a987e0f63 Shaun Tancheff    2016-10-18  338  	struct blk_zone_report rep;
3ed05a987e0f63 Shaun Tancheff    2016-10-18  339  	int ret;
3ed05a987e0f63 Shaun Tancheff    2016-10-18  340  
3ed05a987e0f63 Shaun Tancheff    2016-10-18  341  	if (!argp)
3ed05a987e0f63 Shaun Tancheff    2016-10-18  342  		return -EINVAL;
3ed05a987e0f63 Shaun Tancheff    2016-10-18  343  
3ed05a987e0f63 Shaun Tancheff    2016-10-18  344  	q = bdev_get_queue(bdev);
3ed05a987e0f63 Shaun Tancheff    2016-10-18  345  
edd1dbc83b1de3 Christoph Hellwig 2022-07-06  346  	if (!bdev_is_zoned(bdev))
3ed05a987e0f63 Shaun Tancheff    2016-10-18  347  		return -ENOTTY;
3ed05a987e0f63 Shaun Tancheff    2016-10-18  348  
3ed05a987e0f63 Shaun Tancheff    2016-10-18  349  	if (copy_from_user(&rep, argp, sizeof(struct blk_zone_report)))
3ed05a987e0f63 Shaun Tancheff    2016-10-18  350  		return -EFAULT;
3ed05a987e0f63 Shaun Tancheff    2016-10-18  351  
3ed05a987e0f63 Shaun Tancheff    2016-10-18  352  	if (!rep.nr_zones)
3ed05a987e0f63 Shaun Tancheff    2016-10-18  353  		return -EINVAL;
3ed05a987e0f63 Shaun Tancheff    2016-10-18  354  
d41003513e61dd Christoph Hellwig 2019-11-11  355  	args.zones = argp + sizeof(struct blk_zone_report);
d41003513e61dd Christoph Hellwig 2019-11-11  356  	ret = blkdev_report_zones(bdev, rep.sector, rep.nr_zones,
d41003513e61dd Christoph Hellwig 2019-11-11  357  				  blkdev_copy_zone_to_user, &args);
d41003513e61dd Christoph Hellwig 2019-11-11  358  	if (ret < 0)
3ed05a987e0f63 Shaun Tancheff    2016-10-18  359  		return ret;
d41003513e61dd Christoph Hellwig 2019-11-11  360  
d41003513e61dd Christoph Hellwig 2019-11-11  361  	rep.nr_zones = ret;
82394db7383d33 Matias Bjørling   2020-06-29  362  	rep.flags = BLK_ZONE_REP_CAPACITY;
d41003513e61dd Christoph Hellwig 2019-11-11  363  	if (copy_to_user(argp, &rep, sizeof(struct blk_zone_report)))
d41003513e61dd Christoph Hellwig 2019-11-11  364  		return -EFAULT;
d41003513e61dd Christoph Hellwig 2019-11-11  365  	return 0;
3ed05a987e0f63 Shaun Tancheff    2016-10-18  366  }
3ed05a987e0f63 Shaun Tancheff    2016-10-18  367  

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



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux