Re: [PATCH 06/16] scsi_dh_alua: use local buffer for VPD inquiry

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

 



On 01/17/2014 10:04 AM, Mike Christie wrote:
> On 12/20/2013 06:13 AM, Hannes Reinecke wrote:
>> VPD inquiry need to be done only once, so we can be using
>> a local buffer here.
>>
>> Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
>> ---
>>  drivers/scsi/device_handler/scsi_dh_alua.c | 45 ++++++++++++++++++------------
>>  1 file changed, 27 insertions(+), 18 deletions(-)
>>
>> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
>> index adc77ef..49952f4 100644
>> --- a/drivers/scsi/device_handler/scsi_dh_alua.c
>> +++ b/drivers/scsi/device_handler/scsi_dh_alua.c
>> @@ -322,16 +322,27 @@ static int alua_check_tpgs(struct scsi_device *sdev, struct alua_dh_data *h)
>>   */
>>  static int alua_vpd_inquiry(struct scsi_device *sdev, struct alua_dh_data *h)
>>  {
>> +	unsigned char *buff;
>> +	unsigned char bufflen = 36;
>>  	int len, timeout = ALUA_FAILOVER_TIMEOUT;
>>  	unsigned char sense[SCSI_SENSE_BUFFERSIZE];
>>  	struct scsi_sense_hdr sense_hdr;
>>  	unsigned retval;
>>  	unsigned char *d;
>>  	unsigned long expiry;
>> +	int err;
>>  
>>  	expiry = round_jiffies_up(jiffies + timeout);
>>   retry:
>> -	retval = submit_vpd_inquiry(sdev, h->buff, h->bufflen, sense);
>> +	buff = kmalloc(bufflen, GFP_ATOMIC);
>> +	if (!buff) {
>>
> 
> Why GFP_ATOMIC? I think it can be less restrictive in this path. If you
> need GFP_ATOMIC here, then there are places in this code path you would
> want to change from GFP_KERNEL to GFP_ATOMIC.
> 
Yeah, all right. This is by no means time-critical.

I'll be fixing up the patch.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@xxxxxxx			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux