lkml.org 
[lkml]   [2008]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: linux-next: Tree for August 14 (sysfs/acpi errors)
From
Date
On Mon, 2008-08-18 at 19:43 +1000, Rusty Russell wrote:
> On Monday 18 August 2008 13:48:51 Greg KH wrote:
> > On Sun, Aug 17, 2008 at 05:53:07AM +0200, Andi Kleen wrote:
> > > Greg KH <greg@kroah.com> writes:
> > > >> No!
> > > >
> > > > What you are doing here is wrong, trying to create two files with the
> > > > same name. You just should not be doing that at all, it's that simple.
> > > > Fix the broken code/link order, don't paper it over in the sysfs layer.
> > >
> > > Sorry, but relying on link order for anything is a mistake. It is subtle
> > > and fragile and just means it'll eventually break again because it's
> > > near impossible to properly maintain.
> >
> > We rely on link order for all sorts of things, this isn't new at all.
>
> Sure, but this code should be rewritten to check if the directory exists,
> rather assuming it based on "previous prefix was the same".
>
> It's relying on a horribly undocumented assumption, and it broke.
>
> We need to change kernel_param_sysfs_setup() to do something
> like "kobject_find(module_kset, name)" and only allocate a new mk if that
> fails.

kobj = kset_find_obj(module_kset, name) should return an existing object
with that name (and take a reference on it, which needs to be dropped).

Kay



\
 
 \ /
  Last update: 2008-08-18 13:01    [W:0.089 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site