Re: [PATCH] scsi: target: core: Set MULTIP bit in INQUIRY

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

 



On 9/6/22 2:48 AM, Dmitry Bogdanov wrote:
> 
> diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
> index c14441c89bed..32fb38ce98f4 100644
> --- a/drivers/target/target_core_spc.c
> +++ b/drivers/target/target_core_spc.c
> @@ -75,6 +75,8 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf)
>  	struct se_portal_group *tpg = lun->lun_tpg;
>  	struct se_device *dev = cmd->se_dev;
>  	struct se_session *sess = cmd->se_sess;
> +	struct se_lun *tmp_lun;
> +	size_t dev_ports = 0;
>  
>  	/* Set RMB (removable media) for tape devices */
>  	if (dev->transport->get_device_type(dev) == TYPE_TAPE)
> @@ -115,6 +117,20 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf)
>  			buf[5] |= 0x1;
>  	}
>  
> +	spin_lock(&dev->se_port_lock);
> +	list_for_each_entry(tmp_lun, &dev->dev_sep_list, lun_dev_link) {
> +		dev_ports++;
> +		/* Exact number of ports does not matter for MULTIP bit */
> +		if (dev_ports > 1)
> +			break;

Can you just check se_deice->export_count instead of looping?

Also, setting the bit seems fine. I was just wondering what uses it?



[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