All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/scsi/sd_zbc.c:674 sd_zbc_revalidate_zones() error: kvmalloc() only makes sense with GFP_KERNEL
@ 2021-02-23 11:26 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-02-23 11:26 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 4816 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Johannes Thumshirn <johannes.thumshirn@wdc.com>
CC: Jens Axboe <axboe@kernel.dk>
CC: Christoph Hellwig <hch@lst.de>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: Hannes Reinecke <hare@suse.de>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3b9cdafb5358eb9f3790de2f728f765fef100731
commit: 5795eb443060148796beeba106e4366d7f1458a6 scsi: sd_zbc: emulate ZONE_APPEND commands
date:   10 months ago
:::::: branch date: 9 hours ago
:::::: commit date: 10 months ago
config: microblaze-randconfig-m031-20210223 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/scsi/sd_zbc.c:674 sd_zbc_revalidate_zones() error: kvmalloc() only makes sense with GFP_KERNEL

vim +674 drivers/scsi/sd_zbc.c

5795eb44306014 Johannes Thumshirn 2020-05-12  643  
5795eb44306014 Johannes Thumshirn 2020-05-12  644  static int sd_zbc_revalidate_zones(struct scsi_disk *sdkp,
5795eb44306014 Johannes Thumshirn 2020-05-12  645  				   u32 zone_blocks,
5795eb44306014 Johannes Thumshirn 2020-05-12  646  				   unsigned int nr_zones)
5795eb44306014 Johannes Thumshirn 2020-05-12  647  {
5795eb44306014 Johannes Thumshirn 2020-05-12  648  	struct gendisk *disk = sdkp->disk;
5795eb44306014 Johannes Thumshirn 2020-05-12  649  	int ret = 0;
5795eb44306014 Johannes Thumshirn 2020-05-12  650  
5795eb44306014 Johannes Thumshirn 2020-05-12  651  	/*
5795eb44306014 Johannes Thumshirn 2020-05-12  652  	 * Make sure revalidate zones are serialized to ensure exclusive
5795eb44306014 Johannes Thumshirn 2020-05-12  653  	 * updates of the scsi disk data.
5795eb44306014 Johannes Thumshirn 2020-05-12  654  	 */
5795eb44306014 Johannes Thumshirn 2020-05-12  655  	mutex_lock(&sdkp->rev_mutex);
5795eb44306014 Johannes Thumshirn 2020-05-12  656  
5795eb44306014 Johannes Thumshirn 2020-05-12  657  	/*
5795eb44306014 Johannes Thumshirn 2020-05-12  658  	 * Revalidate the disk zones to update the device request queue zone
5795eb44306014 Johannes Thumshirn 2020-05-12  659  	 * bitmaps and the zone write pointer offset array. Do this only once
5795eb44306014 Johannes Thumshirn 2020-05-12  660  	 * the device capacity is set on the second revalidate execution for
5795eb44306014 Johannes Thumshirn 2020-05-12  661  	 * disk scan or if something changed when executing a normal revalidate.
5795eb44306014 Johannes Thumshirn 2020-05-12  662  	 */
5795eb44306014 Johannes Thumshirn 2020-05-12  663  	if (sdkp->first_scan) {
5795eb44306014 Johannes Thumshirn 2020-05-12  664  		sdkp->zone_blocks = zone_blocks;
5795eb44306014 Johannes Thumshirn 2020-05-12  665  		sdkp->nr_zones = nr_zones;
5795eb44306014 Johannes Thumshirn 2020-05-12  666  		goto unlock;
5795eb44306014 Johannes Thumshirn 2020-05-12  667  	}
5795eb44306014 Johannes Thumshirn 2020-05-12  668  
5795eb44306014 Johannes Thumshirn 2020-05-12  669  	if (sdkp->zone_blocks == zone_blocks &&
5795eb44306014 Johannes Thumshirn 2020-05-12  670  	    sdkp->nr_zones == nr_zones &&
5795eb44306014 Johannes Thumshirn 2020-05-12  671  	    disk->queue->nr_zones == nr_zones)
5795eb44306014 Johannes Thumshirn 2020-05-12  672  		goto unlock;
5795eb44306014 Johannes Thumshirn 2020-05-12  673  
5795eb44306014 Johannes Thumshirn 2020-05-12 @674  	sdkp->rev_wp_offset = kvcalloc(nr_zones, sizeof(u32), GFP_NOIO);
5795eb44306014 Johannes Thumshirn 2020-05-12  675  	if (!sdkp->rev_wp_offset) {
5795eb44306014 Johannes Thumshirn 2020-05-12  676  		ret = -ENOMEM;
5795eb44306014 Johannes Thumshirn 2020-05-12  677  		goto unlock;
5795eb44306014 Johannes Thumshirn 2020-05-12  678  	}
5795eb44306014 Johannes Thumshirn 2020-05-12  679  
5795eb44306014 Johannes Thumshirn 2020-05-12  680  	ret = blk_revalidate_disk_zones(disk, sd_zbc_revalidate_zones_cb);
5795eb44306014 Johannes Thumshirn 2020-05-12  681  
5795eb44306014 Johannes Thumshirn 2020-05-12  682  	kvfree(sdkp->rev_wp_offset);
5795eb44306014 Johannes Thumshirn 2020-05-12  683  	sdkp->rev_wp_offset = NULL;
5795eb44306014 Johannes Thumshirn 2020-05-12  684  
5795eb44306014 Johannes Thumshirn 2020-05-12  685  unlock:
5795eb44306014 Johannes Thumshirn 2020-05-12  686  	mutex_unlock(&sdkp->rev_mutex);
5795eb44306014 Johannes Thumshirn 2020-05-12  687  
5795eb44306014 Johannes Thumshirn 2020-05-12  688  	return ret;
5795eb44306014 Johannes Thumshirn 2020-05-12  689  }
5795eb44306014 Johannes Thumshirn 2020-05-12  690  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 26582 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-23 11:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 11:26 drivers/scsi/sd_zbc.c:674 sd_zbc_revalidate_zones() error: kvmalloc() only makes sense with GFP_KERNEL kernel test robot

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.