[dm-devel] [PATCH] libmultipath/discovery: read sysfs files uncached

Sebastian Riemer sebastian.riemer at profitbricks.com
Thu Apr 4 10:47:26 UTC 2013


On 04.04.2013 12:20, Hannes Reinecke wrote:
> On 04/04/2013 12:00 PM, Kay Sievers wrote:
>> On Thu, Apr 4, 2013 at 8:43 AM, Hannes Reinecke <hare at suse.de> wrote:
>>>>> Unfortunately, libudev doesn't provide an uncached variant. This
>>>>> is why we have to reimplement the functionality and some libudev
>>>>> internal functions here.
>>
>> Hannes,
>>
>> didn't you intend to use udev_device_set_sysattr_value(..., attribute,
>> NULL); to clear the cached value?
>>
> 
> Yes, it should. Question remains, though, what happens to the actual
> sysfs attribute.
> Does it remain unchained? Will it be set to '0'?

I had a look at systemd-200.tar.xz. If the value is NULL, then only the
value length is set to zero. So the sysfs file is still opened and
write() gets zero length as argument. So the file remains unchanged.
Afterwards, NULL is stored in the cache as value. For me this isn't
implemented right as you are bugging the kernel with open() and close()
without a need. Furthermore, Debian Squeeze doesn't have that
"udev_device_set_sysattr_value()" function. So at least that
distribution could need a workaround.

Cheers,
Sebastian




More information about the dm-devel mailing list