lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 11 Nov 2021 23:25:51 +0800
From:   kernel test robot <lkp@...el.com>
To:     Hannes Reinecke <hare@...e.de>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [hare-scsi-devel:scsi-private.v2 8/21] drivers/scsi/hpsa.c:6069:33:
 error: 'struct scsi_cmnd' has no member named 'request'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git scsi-private.v2
head:   915b986531e666d840f72752c597fb6b4ea69d35
commit: 9847ce30bd0993567f380f282af9ffa1086b6b53 [8/21] hpsa: use reserved commands
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commit/?id=9847ce30bd0993567f380f282af9ffa1086b6b53
        git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
        git fetch --no-tags hare-scsi-devel scsi-private.v2
        git checkout 9847ce30bd0993567f380f282af9ffa1086b6b53
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

   drivers/scsi/hpsa.c: In function 'hpsa_eh_device_reset_handler':
>> drivers/scsi/hpsa.c:6069:33: error: 'struct scsi_cmnd' has no member named 'request'
    6069 |                          scsicmd->request->tag);
         |                                 ^~
   drivers/scsi/hpsa.c:6079:33: error: 'struct scsi_cmnd' has no member named 'request'
    6079 |                          scsicmd->request->tag);
         |                                 ^~
   drivers/scsi/hpsa.c: In function 'cmd_tagged_alloc':
   drivers/scsi/hpsa.c:6142:23: error: 'struct scsi_cmnd' has no member named 'request'
    6142 |         int idx = scmd->request->tag;
         |                       ^~
   drivers/scsi/hpsa.c: In function 'cmd_alloc':
>> drivers/scsi/hpsa.c:6200:43: error: passing argument 1 of 'scsi_host_get_internal_cmd' from incompatible pointer type [-Werror=incompatible-pointer-types]
    6200 |         scmd = scsi_host_get_internal_cmd(h, (direction & XFER_WRITE) ?
         |                                           ^
         |                                           |
         |                                           struct ctlr_info *
   In file included from drivers/scsi/hpsa.c:42:
   include/scsi/scsi_host.h:814:34: note: expected 'struct Scsi_Host *' but argument is of type 'struct ctlr_info *'
     814 | void *scsi_host_get_internal_cmd(struct Scsi_Host *, int data_direction,
         |                                  ^~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors


vim +6069 drivers/scsi/hpsa.c

  6025	
  6026	/* Need at least one of these error handlers to keep ../scsi/hosts.c from
  6027	 * complaining.  Doing a host- or bus-reset can't do anything good here.
  6028	 */
  6029	static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
  6030	{
  6031		int rc = SUCCESS;
  6032		int i;
  6033		struct ctlr_info *h;
  6034		struct hpsa_scsi_dev_t *dev = NULL;
  6035		u8 reset_type;
  6036		char msg[48];
  6037		unsigned long flags;
  6038	
  6039		/* find the controller to which the command to be aborted was sent */
  6040		h = sdev_to_hba(scsicmd->device);
  6041		if (h == NULL) /* paranoia */
  6042			return FAILED;
  6043	
  6044		spin_lock_irqsave(&h->reset_lock, flags);
  6045		h->reset_in_progress = 1;
  6046		spin_unlock_irqrestore(&h->reset_lock, flags);
  6047	
  6048		if (lockup_detected(h)) {
  6049			rc = FAILED;
  6050			goto return_reset_status;
  6051		}
  6052	
  6053		dev = scsicmd->device->hostdata;
  6054		if (!dev) {
  6055			dev_err(&h->pdev->dev, "%s: device lookup failed\n", __func__);
  6056			rc = FAILED;
  6057			goto return_reset_status;
  6058		}
  6059	
  6060		if (dev->devtype == TYPE_ENCLOSURE) {
  6061			rc = SUCCESS;
  6062			goto return_reset_status;
  6063		}
  6064	
  6065		/* if controller locked up, we can guarantee command won't complete */
  6066		if (lockup_detected(h)) {
  6067			snprintf(msg, sizeof(msg),
  6068				 "cmd %d RESET FAILED, lockup detected",
> 6069				 scsicmd->request->tag);
  6070			hpsa_show_dev_msg(KERN_WARNING, h, dev, msg);
  6071			rc = FAILED;
  6072			goto return_reset_status;
  6073		}
  6074	
  6075		/* this reset request might be the result of a lockup; check */
  6076		if (detect_controller_lockup(h)) {
  6077			snprintf(msg, sizeof(msg),
  6078				 "cmd %d RESET FAILED, new lockup detected",
> 6079				 scsicmd->request->tag);
  6080			hpsa_show_dev_msg(KERN_WARNING, h, dev, msg);
  6081			rc = FAILED;
  6082			goto return_reset_status;
  6083		}
  6084	
  6085		/* Do not attempt on controller */
  6086		if (is_hba_lunid(dev->scsi3addr)) {
  6087			rc = SUCCESS;
  6088			goto return_reset_status;
  6089		}
  6090	
  6091		if (is_logical_dev_addr_mode(dev->scsi3addr))
  6092			reset_type = HPSA_DEVICE_RESET_MSG;
  6093		else
  6094			reset_type = HPSA_PHYS_TARGET_RESET;
  6095	
  6096		sprintf(msg, "resetting %s",
  6097			reset_type == HPSA_DEVICE_RESET_MSG ? "logical " : "physical ");
  6098		hpsa_show_dev_msg(KERN_WARNING, h, dev, msg);
  6099	
  6100		/*
  6101		 * wait to see if any commands will complete before sending reset
  6102		 */
  6103		dev->in_reset = true; /* block any new cmds from OS for this device */
  6104		for (i = 0; i < 10; i++) {
  6105			if (atomic_read(&dev->commands_outstanding) > 0)
  6106				msleep(1000);
  6107			else
  6108				break;
  6109		}
  6110	
  6111		/* send a reset to the SCSI LUN which the command was sent to */
  6112		rc = hpsa_do_reset(h, dev, reset_type, DEFAULT_REPLY_QUEUE);
  6113		if (rc == 0)
  6114			rc = SUCCESS;
  6115		else
  6116			rc = FAILED;
  6117	
  6118		sprintf(msg, "reset %s %s",
  6119			reset_type == HPSA_DEVICE_RESET_MSG ? "logical " : "physical ",
  6120			rc == SUCCESS ? "completed successfully" : "failed");
  6121		hpsa_show_dev_msg(KERN_WARNING, h, dev, msg);
  6122	
  6123	return_reset_status:
  6124		spin_lock_irqsave(&h->reset_lock, flags);
  6125		h->reset_in_progress = 0;
  6126		if (dev)
  6127			dev->in_reset = false;
  6128		spin_unlock_irqrestore(&h->reset_lock, flags);
  6129		return rc;
  6130	}
  6131	
  6132	/*
  6133	 * For operations with an associated SCSI command, a command block is allocated
  6134	 * at init, and managed by cmd_tagged_alloc() and cmd_tagged_free() using the
  6135	 * block request tag as an index into a table of entries.  cmd_tagged_free() is
  6136	 * the complement, although cmd_free() may be called instead.
  6137	 * This function is only called for new requests from queue_command.
  6138	 */
  6139	static struct CommandList *cmd_tagged_alloc(struct ctlr_info *h,
  6140						    struct scsi_cmnd *scmd)
  6141	{
  6142		int idx = scmd->request->tag;
  6143		struct CommandList *c = h->cmd_pool + idx;
  6144	
  6145		if (idx < 0 || idx >= h->nr_cmds) {
  6146			dev_err(&h->pdev->dev, "Bad block tag: %d not in [%d..%d]\n",
  6147				idx, 0, h->nr_cmds - 1);
  6148			/* The index value comes from the block layer, so if it's out of
  6149			 * bounds, it's probably not our bug.
  6150			 */
  6151			BUG();
  6152		}
  6153	
  6154		if (unlikely(!hpsa_is_cmd_idle(c))) {
  6155			/*
  6156			 * We expect that the SCSI layer will hand us a unique tag
  6157			 * value.  Thus, there should never be a collision here between
  6158			 * two requests...because if the selected command isn't idle
  6159			 * then someone is going to be very disappointed.
  6160			 */
  6161			if (idx != h->last_collision_tag) { /* Print once per tag */
  6162				dev_warn(&h->pdev->dev,
  6163					"%s: tag collision (tag=%d)\n", __func__, idx);
  6164				if (scmd)
  6165					scsi_print_command(scmd);
  6166				h->last_collision_tag = idx;
  6167			}
  6168			return NULL;
  6169		}
  6170	
  6171		atomic_inc(&c->refcount);
  6172		hpsa_cmd_partial_init(h, idx, c);
  6173	
  6174		/*
  6175		 * This is a new command obtained from queue_command so
  6176		 * there have not been any driver initiated retry attempts.
  6177		 */
  6178		c->retry_pending = false;
  6179	
  6180		return c;
  6181	}
  6182	
  6183	static void cmd_tagged_free(struct ctlr_info *h, struct CommandList *c)
  6184	{
  6185		/*
  6186		 * Release our reference to the block.  We don't need to do anything
  6187		 * else to free it, because it is accessed by index.
  6188		 */
  6189		(void)atomic_dec(&c->refcount);
  6190		c->scsi_cmd = NULL;
  6191	}
  6192	
  6193	static struct CommandList *cmd_alloc(struct ctlr_info *h, u8 direction)
  6194	{
  6195		struct scsi_cmnd *scmd;
  6196		struct request *rq;
  6197		struct CommandList *c;
  6198		int idx;
  6199	
> 6200		scmd = scsi_host_get_internal_cmd(h, (direction & XFER_WRITE) ?
  6201						  DMA_TO_DEVICE : DMA_FROM_DEVICE,
  6202						  REQ_NOWAIT);
  6203		if (!scmd) {
  6204			dev_warn(&h->pdev->dev, "failed to allocate reserved cmd\n");
  6205			return NULL;
  6206		}
  6207		rq = scsi_cmd_to_rq(scmd);
  6208		idx = rq->tag;
  6209		c = cmd_tagged_alloc(h, scmd);
  6210		if (!c) {
  6211			dev_warn(&h->pdev->dev, "failed to allocate reserved cmd %u\n",
  6212				 idx);
  6213			scsi_put_internal_cmd(scmd);
  6214			return NULL;
  6215		}
  6216		hpsa_cmd_partial_init(h, idx, c);
  6217		c->scsi_cmd = scmd;
  6218		c->device = NULL;
  6219		c->cmd_type = CMD_IOCTL_PEND;
  6220		dev_dbg(&h->pdev->dev, "using reserved cmd %u\n", idx);
  6221		return c;
  6222	}
  6223	

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

Download attachment ".config.gz" of type "application/gzip" (69180 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ