Re: [RFC PATCH v1 08/15] node_device_udev: Take lock if `driver->privateData` is modified

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

 



On Thu, Apr 18, 2024 at 01:48 PM -0500, Jonathon Jongsma <jjongsma@xxxxxxxxxx> wrote:
> On 4/12/24 8:36 AM, Marc Hartmayer wrote:
>> Since @driver->privateData is modified take the lock.
>>

[…snip…]

>>        * signal if that event never comes */
>> -    scheduleMdevctlUpdate(priv, (event_type == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT));
>> +    VIR_WITH_OBJECT_LOCK_GUARD(priv) {
>> +        scheduleMdevctlUpdate(priv, (event_type == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT));
>> +    }
>>   }
>>   
>>   
>
> I don't see any cases where we would not want to take the lock (e.g. 
> because it has already been taken), so maybe it would be better simply 
> to lock the object within the scheduleMdevctlUpdate() function rather 
> than requiring each caller to lock it?

Hmm, with patch 15 in mind this would make the code more complicated.

>
> Reviewed-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
>
-- 
Kind regards / Beste Grüße
   Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux