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

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



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


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