Re: problem with duplicate sysfs directories and files

From: Greg KH
Date: Thu Mar 09 2006 - 19:10:45 EST


On Thu, Mar 09, 2006 at 07:40:14PM +0530, Maneesh Soni wrote:
> On Wed, Mar 08, 2006 at 09:58:16PM -0800, Greg KH wrote:
>
> >
> > I have a test module that shows this at:
> > http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/gregkh/sysfs-test.patch
> > just load the 'gregkh' module and look in /sys/class/gregkh/ to see the
> > duplicate "gregkh1" directories.
> >
>
> Thnaks for the testcase, I could verify the following patch using this. I
> don't see the duplicate "gregkh1" directories. Please queue it for post 2.6.16
> if you are ok with it.

Looks good. I tweaked it a bit (returned -EEXIST from functions if the
file already existed), and renamed the function to play nicer in the
global namespace. Updated patch is below

Thanks a lot for doing this, I appreciate it.

greg k-h

-------------