Re: [PATCH 2/3] sd_zbc: Fix report zones buffer allocation

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

 



Hi Damien,

I love your patch! Yet something to improve:

[auto build test ERROR on block/for-next]
[also build test ERROR on v5.2-rc6 next-20190621]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Damien-Le-Moal/Fix-zone-revalidation-memory-allocation-failures/20190625-175053
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sparc64 

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

All error/warnings (new ones prefixed by >>):

   drivers/scsi/sd_zbc.c: In function 'sd_zbc_alloc_report_buffer':
>> drivers/scsi/sd_zbc.c:141:8: error: implicit declaration of function '__vmalloc'; did you mean '__kmalloc'? [-Werror=implicit-function-declaration]
     buf = __vmalloc(bufsize, gfp_mask, PAGE_KERNEL);
           ^~~~~~~~~
           __kmalloc
>> drivers/scsi/sd_zbc.c:141:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     buf = __vmalloc(bufsize, gfp_mask, PAGE_KERNEL);
         ^
   cc1: some warnings being treated as errors

vim +141 drivers/scsi/sd_zbc.c

   110	
   111	/**
   112	 * Allocate a buffer for report zones reply.
   113	 * @disk: The target disk
   114	 * @nr_zones: Maximum number of zones to report
   115	 * @buflen: Size of the buffer allocated
   116	 * @gfp_mask: Memory allocation mask
   117	 *
   118	 */
   119	static void *sd_zbc_alloc_report_buffer(struct request_queue *q,
   120						unsigned int nr_zones, size_t *buflen,
   121						gfp_t gfp_mask)
   122	{
   123		size_t bufsize;
   124		void *buf;
   125	
   126		/*
   127		 * Report zone buffer size should be at most 64B times the number of
   128		 * zones requested plus the 64B reply header, but should be at least
   129		 * SECTOR_SIZE for ATA devices.
   130		 * Make sure that this size does not exceed the hardware capabilities.
   131		 * Furthermore, since the report zone command cannot be split, make
   132		 * sure that the allocated buffer can always be mapped by limiting the
   133		 * number of pages allocated to the HBA max segments limit.
   134		 */
   135		nr_zones = min(nr_zones, SD_ZBC_REPORT_MAX_ZONES);
   136		bufsize = roundup((nr_zones + 1) * 64, 512);
   137		bufsize = min_t(size_t, bufsize,
   138				queue_max_hw_sectors(q) << SECTOR_SHIFT);
   139		bufsize = min_t(size_t, bufsize, queue_max_segments(q) << PAGE_SHIFT);
   140	
 > 141		buf = __vmalloc(bufsize, gfp_mask, PAGE_KERNEL);
   142		if (buf)
   143			*buflen = bufsize;
   144	
   145		return buf;
   146	}
   147	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[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