On 02/03/2017 02:31 PM, Christoph Hellwig wrote:
>> - if (sg_res_in_use(sfp)) {
>> + mutex_lock(&sfp->f_mutex);
>> + if (sfp->res_in_use) {
>> + mutex_unlock(&sfp->f_mutex);
>> sg_remove_request(sfp, srp);
>> return -EBUSY; /* reserve buffer already being used */
>> }
>> + mutex_unlock(&sfp->f_mutex);
>
> Holding a mutex over a the check of a single scalar doesn't make sense.
>
It's adds a synchronisation point, doesn't it?
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
[email protected] +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)