From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kay Sievers" Date: Mon, 15 Sep 2008 18:32:49 +0000 Subject: Re: [PATCH 2/3] sysfs: sysfs_attr_get_value() writes to a buffer instead of returning a string Message-Id: <3ae72650809151132u347417f8nab4293854d1147f1@mail.gmail.com> List-Id: References: <48BFEEF4.8040000@tuffmail.co.uk> In-Reply-To: <48BFEEF4.8040000@tuffmail.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Wed, Sep 10, 2008 at 04:09, Kay Sievers wrote: > On Wed, 2008-09-10 at 11:21 +0100, Alan Jenkins wrote: >> Alan Jenkins wrote: >> > This avoids lifetime issues with the returned string, for subsequent changes >> > to caching in sysfs. All callers are changed accordingly. Many callers >> > copied the result to a buffer already, so this actually simplifies some code. >> > >> >> Sorry, my re-implementation of sysfs_attr_get_value() was defective. It >> didn't return cached values correctly. >> >> I suggest you drop these two patches. I'll fix the bug and update them >> to apply on top of the recent libudev/logging changes. > > I didn't apply them, as I was busy with other stuff in libudev. We > should move the "sysfs cache" to the lib, hanging off of the the > udev_device, I guess. For this we will need to add parent device > relations in the udev_device. The current global device and attribute > cache will just go away then. > > We will get there after the current work on the lib, which means > converting more stuff to libudev, and use it in the udev code. > We will also soon get rid of all dependencies on udev code in libudev, > which will remove the current udev sysfs code from libudev. We are getting closer. Current libudev does not use any main udev code anymore. Libudev's "udev_device" does parent-device and sysfs-attribute value "caching" now. Kay