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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46F9D83D.5050305@garzik.org>
Date:	Tue, 25 Sep 2007 23:55:41 -0400
From:	Jeff Garzik <jeff@...zik.org>
To:	James Bottomley <James.Bottomley@...elEye.com>
CC:	Matthew Wilcox <matthew@....cx>, FUJITA Tomonori <tomof@....org>,
	akpm@...ux-foundation.org, linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org, fujita.tomonori@....ntt.co.jp
Subject: Re: queued patches for SCSI for 2.6.24

James Bottomley wrote:
> This whole mess is generated basically because the zero default of the
> template should be treated as initiator.  How about this, which makes
> that manifest?
> 
> James
> 
> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
> index adc9559..7e26440 100644
> --- a/drivers/scsi/hosts.c
> +++ b/drivers/scsi/hosts.c
> @@ -342,7 +342,11 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
>  	shost->unchecked_isa_dma = sht->unchecked_isa_dma;
>  	shost->use_clustering = sht->use_clustering;
>  	shost->ordered_tag = sht->ordered_tag;
> -	shost->active_mode = sht->supported_mode;
> +	if (sht->supported_mode == MODE_UNKNOWN)
> +		/* means we didn't set it ... default to INITIATOR */
> +		shost->active_mode = MODE_INITIATOR;
> +	else
> +		shost->active_mode = sht->supported_mode;
>  
>  	if (sht->max_host_blocked)
>  		shost->max_host_blocked = sht->max_host_blocked;
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index 0088c4d..4965e9e 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -209,11 +209,13 @@ show_shost_mode(unsigned int mode, char *buf)
>  static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *buf)
>  {
>  	struct Scsi_Host *shost = class_to_shost(class_dev);
> +	unsigned int supported_mode = shost->hostt->supported_mode;
>  
> -	if (shost->hostt->supported_mode == MODE_UNKNOWN)
> -		return snprintf(buf, 20, "unknown\n");
> -	else
> -		return show_shost_mode(shost->hostt->supported_mode, buf);
> +	if (supported_mode == MODE_UNKNOWN)
> +		/* by default this should be initiator */
> +		supported_mode = MODE_INITIATOR;
> +
> +	return show_shost_mode(shost->hostt->supported_mode, buf);
>  }
>  
>  static CLASS_DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL);


ACK

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ