[lvm-devel][PATCH 3/4] Udev integration: add cookie support for dmsetup

Peter Rajnoha prajnoha at redhat.com
Tue Apr 21 19:07:56 UTC 2009


On 04/21/2009 08:33 PM, Dave Wysochanski wrote:
>> -	if (!dm_task_run(dmt))
>> +	if (!dm_notification_sem_open(&cookie) ||
>> +			!dm_notification_sem_inc(cookie) ||
>> +			!dm_task_set_cookie(dmt, cookie))
>>  		goto out;
>>  
>> +	if (!dm_task_run(dmt)) {
>> +		dm_notification_sem_close(cookie);
>> +		goto out;
>> +	}
>> +
>> +	dm_notification_sem_wait_zero(cookie);
>> +	dm_notification_sem_close(cookie);
>> +
>>  	r = 1;
> 
> 
> This piece of code could exit without cleanup of the semaphore.  Should
> the first 'if' only check !dm_notification_sem_open, and the sem_inc and
> set_cookie be '||'d with dm_task_run in the second 'if'?

Oh, sure. I have to correct this. Thanks!

Peter




More information about the lvm-devel mailing list