Re: [target:for-next-merge 61/61] drivers/target/iscsi/cxgbit/cxgbit_target.c:706:1: warning: 'cxgbit_tx_datain' uses dynamic stack allocation

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

 



Hi Varun & Co,

(Adding target-devel CC')

On Sat, 2016-02-27 at 12:14 +0800, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git for-next-merge
> head:   98738c3003e61b5f35f2b59cb941efebe52b0e1c
> commit: 98738c3003e61b5f35f2b59cb941efebe52b0e1c [61/61] iscsi-target: update Kconfig and Makefile
> config: s390-allmodconfig (attached as .config)
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git checkout 98738c3003e61b5f35f2b59cb941efebe52b0e1c
>         # save the attached .config to linux build tree
>         make.cross ARCH=s390 
> 
> All warnings (new ones prefixed by >>):
> 
>    drivers/target/iscsi/cxgbit/cxgbit_target.c: In function 'cxgbit_tx_datain':
> >> drivers/target/iscsi/cxgbit/cxgbit_target.c:706:1: warning: 'cxgbit_tx_datain' uses dynamic stack allocation
>     }
>     ^
>    drivers/target/iscsi/cxgbit/cxgbit_target.c: In function 'cxgbit_tx_datain_iso':
> >> drivers/target/iscsi/cxgbit/cxgbit_target.c:624:1: warning: 'cxgbit_tx_datain_iso' uses dynamic stack allocation
>     }
>     ^
> 
> vim +/cxgbit_tx_datain +706 drivers/target/iscsi/cxgbit/cxgbit_target.c
> 
> a1ddb85b Varun Prakash 2016-02-14  618  
> a1ddb85b Varun Prakash 2016-02-14  619  	ret = task_sense ? 2 : 1;
> a1ddb85b Varun Prakash 2016-02-14  620  	return ret;
> a1ddb85b Varun Prakash 2016-02-14  621  
> a1ddb85b Varun Prakash 2016-02-14  622  out:
> a1ddb85b Varun Prakash 2016-02-14  623  	return ret;
> a1ddb85b Varun Prakash 2016-02-14 @624  }
> a1ddb85b Varun Prakash 2016-02-14  625  
> a1ddb85b Varun Prakash 2016-02-14  626  static int cxgbit_tx_datain(struct cxgbit_sock *csk, struct iscsi_cmd *cmd)
> a1ddb85b Varun Prakash 2016-02-14  627  {
> a1ddb85b Varun Prakash 2016-02-14  628  	struct iscsi_conn *conn = csk->conn;
> a1ddb85b Varun Prakash 2016-02-14  629  	struct sk_buff *skb;
> a1ddb85b Varun Prakash 2016-02-14  630  	struct iscsi_datain datain;
> a1ddb85b Varun Prakash 2016-02-14  631  	struct iscsi_datain_req *dr;
> a1ddb85b Varun Prakash 2016-02-14  632  	int eodr = 0;
> a1ddb85b Varun Prakash 2016-02-14  633  	bool set_statsn = false;
> a1ddb85b Varun Prakash 2016-02-14  634  	int ret = 0;
> a1ddb85b Varun Prakash 2016-02-14  635  
> a1ddb85b Varun Prakash 2016-02-14  636  	memset(&datain, 0, sizeof(struct iscsi_datain));
> a1ddb85b Varun Prakash 2016-02-14  637  
> a1ddb85b Varun Prakash 2016-02-14  638  	dr = iscsit_get_datain_values(cmd, &datain);
> a1ddb85b Varun Prakash 2016-02-14  639  	if (!dr) {
> a1ddb85b Varun Prakash 2016-02-14  640  		pr_err("iscsit_get_datain_values failed for ITT: 0x%08x\n",
> a1ddb85b Varun Prakash 2016-02-14  641  		       cmd->init_task_tag);
> a1ddb85b Varun Prakash 2016-02-14  642  		return -1;
> a1ddb85b Varun Prakash 2016-02-14  643  	}
> a1ddb85b Varun Prakash 2016-02-14  644  
> a1ddb85b Varun Prakash 2016-02-14  645  	/*
> a1ddb85b Varun Prakash 2016-02-14  646  	 * Be paranoid and double check the logic for now.
> a1ddb85b Varun Prakash 2016-02-14  647  	 */
> a1ddb85b Varun Prakash 2016-02-14  648  	if ((datain.offset + datain.length) > cmd->se_cmd.data_length) {
> a1ddb85b Varun Prakash 2016-02-14  649  		pr_err("Command ITT: 0x%08x, datain.offset: %u and"
> a1ddb85b Varun Prakash 2016-02-14  650  			" datain.length: %u exceeds cmd->data_length: %u\n",
> a1ddb85b Varun Prakash 2016-02-14  651  			cmd->init_task_tag, datain.offset, datain.length,
> a1ddb85b Varun Prakash 2016-02-14  652  			cmd->se_cmd.data_length);
> a1ddb85b Varun Prakash 2016-02-14  653  		return -1;
> a1ddb85b Varun Prakash 2016-02-14  654  	}
> a1ddb85b Varun Prakash 2016-02-14  655  
> a1ddb85b Varun Prakash 2016-02-14  656  	atomic_long_add(datain.length, &conn->sess->tx_data_octets);
> a1ddb85b Varun Prakash 2016-02-14  657  	/*
> a1ddb85b Varun Prakash 2016-02-14  658  	 * Special case for successfully execution w/ both DATAIN
> a1ddb85b Varun Prakash 2016-02-14  659  	 * and Sense Data.
> a1ddb85b Varun Prakash 2016-02-14  660  	 */
> a1ddb85b Varun Prakash 2016-02-14  661  	if ((datain.flags & ISCSI_FLAG_DATA_STATUS) &&
> a1ddb85b Varun Prakash 2016-02-14  662  	    (cmd->se_cmd.se_cmd_flags & SCF_TRANSPORT_TASK_SENSE))
> a1ddb85b Varun Prakash 2016-02-14  663  		datain.flags &= ~ISCSI_FLAG_DATA_STATUS;
> a1ddb85b Varun Prakash 2016-02-14  664  	else {
> a1ddb85b Varun Prakash 2016-02-14  665  		if ((dr->dr_complete == DATAIN_COMPLETE_NORMAL) ||
> a1ddb85b Varun Prakash 2016-02-14  666  		    (dr->dr_complete == DATAIN_COMPLETE_CONNECTION_RECOVERY)) {
> a1ddb85b Varun Prakash 2016-02-14  667  			iscsit_increment_maxcmdsn(cmd, conn->sess);
> a1ddb85b Varun Prakash 2016-02-14  668  			cmd->stat_sn = conn->stat_sn++;
> a1ddb85b Varun Prakash 2016-02-14  669  			set_statsn = true;
> a1ddb85b Varun Prakash 2016-02-14  670  		} else if (dr->dr_complete ==
> a1ddb85b Varun Prakash 2016-02-14  671  			   DATAIN_COMPLETE_WITHIN_COMMAND_RECOVERY)
> a1ddb85b Varun Prakash 2016-02-14  672  			set_statsn = true;
> a1ddb85b Varun Prakash 2016-02-14  673  	}
> a1ddb85b Varun Prakash 2016-02-14  674  
> a1ddb85b Varun Prakash 2016-02-14  675  	skb = cxgbit_alloc_skb(csk, 0);
> a1ddb85b Varun Prakash 2016-02-14  676  	if (!skb)
> a1ddb85b Varun Prakash 2016-02-14  677  		return -ENOMEM;
> a1ddb85b Varun Prakash 2016-02-14  678  
> a1ddb85b Varun Prakash 2016-02-14  679  	if (datain.length) {
> a1ddb85b Varun Prakash 2016-02-14  680  		cxgbit_skcb_submode(skb) |= (csk->submode &
> a1ddb85b Varun Prakash 2016-02-14  681  				CXGBIT_SUBMODE_DCRC);
> a1ddb85b Varun Prakash 2016-02-14  682  		cxgbit_skcb_tx_extralen(skb) =
> a1ddb85b Varun Prakash 2016-02-14  683  				cxgbit_digest_len[cxgbit_skcb_submode(skb)];
> a1ddb85b Varun Prakash 2016-02-14  684  	}
> a1ddb85b Varun Prakash 2016-02-14  685  
> a1ddb85b Varun Prakash 2016-02-14  686  	iscsit_build_datain_pdu(cmd, conn, &datain,
> a1ddb85b Varun Prakash 2016-02-14  687  				(struct iscsi_data_rsp *)skb->data, set_statsn);
> a1ddb85b Varun Prakash 2016-02-14  688  
> a1ddb85b Varun Prakash 2016-02-14  689  	ret = cxgbit_map_skb(cmd, skb, datain.offset, datain.length);
> a1ddb85b Varun Prakash 2016-02-14  690  	if (ret < 0) {
> a1ddb85b Varun Prakash 2016-02-14  691  		__kfree_skb(skb);
> a1ddb85b Varun Prakash 2016-02-14  692  		return ret;
> a1ddb85b Varun Prakash 2016-02-14  693  	}
> a1ddb85b Varun Prakash 2016-02-14  694  
> a1ddb85b Varun Prakash 2016-02-14  695  	ret = cxgbit_queue_skb(csk, skb);
> a1ddb85b Varun Prakash 2016-02-14  696  	if (ret < 0)
> a1ddb85b Varun Prakash 2016-02-14  697  		return ret;
> a1ddb85b Varun Prakash 2016-02-14  698  
> a1ddb85b Varun Prakash 2016-02-14  699  	if (dr->dr_complete) {
> a1ddb85b Varun Prakash 2016-02-14  700  		eodr = (cmd->se_cmd.se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) ?
> a1ddb85b Varun Prakash 2016-02-14  701  				2 : 1;
> a1ddb85b Varun Prakash 2016-02-14  702  		iscsit_free_datain_req(cmd, dr);
> a1ddb85b Varun Prakash 2016-02-14  703  	}
> a1ddb85b Varun Prakash 2016-02-14  704  
> a1ddb85b Varun Prakash 2016-02-14  705  	return eodr;
> a1ddb85b Varun Prakash 2016-02-14 @706  }
> a1ddb85b Varun Prakash 2016-02-14  707  
> a1ddb85b Varun Prakash 2016-02-14  708  static int cxgbit_send_datain(struct iscsi_cmd *cmd,
> a1ddb85b Varun Prakash 2016-02-14  709  			      struct iscsi_conn *conn)
> 
> :::::: The code at line 706 was first introduced by commit
> :::::: a1ddb85bfc2456370dada09e96d84d5c60743107 cxgbit: add cxgbit_target.c
> 
> :::::: TO: Varun Prakash <varun@xxxxxxxxxxx>
> :::::: CC: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

AFAICT, this is an s390 specific false positive, and can be safely
ignored:

http://www.spinics.net/lists/linux-mm/msg97050.html

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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