Re: [PATCH 16/20] scsi_dh_alua: Use workqueue for RTPG

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

 



On 07/24/2015 05:21 PM, Christoph Hellwig wrote:
>> +	char			work_q_name[264];
> 
> create_workqueue and friends now accept printf-like format
> string, so there is no need for this temporary buffer.
> 
>> +	int			error;
>> +	struct completion       init_complete;
> 
> Please rename error to init_error and only assign to it before calling
> complete().
> 
> Also I'm not sure what the real point of init_complete is, shouldn't
> we just have a mutex held in alua_initialize and alua_activate to
> synchronize the two against each other?
> 
Hmm. I guess I could; I'll check here.

>> +	rcu_read_lock();
>> +	pg = rcu_dereference(h->pg);
>> +	if (pg) {
>> +		kref_get(&pg->kref);
>> +		rcu_read_unlock();
>> +		alua_rtpg_queue(pg, sdev, NULL);
>> +		kref_put(&pg->kref, release_port_group);
>> +	} else
>> +		rcu_read_unlock();
>> +}
> 
> How about:
> 
> 	rcu_read_lock();
> 	pg = rcu_dereference(h->pg);
> 	if (!pg) {
> 		rcu_read_unlock();
> 		return;
> 	}
> 
> 	kref_get(&pg->kref);
> 	rcu_read_unlock();
> 	alua_rtpg_queue(pg, sdev, NULL);
> 	kref_put(&pg->kref, release_port_group);
> 

Ok.

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