lkml.org 
[lkml]   [2013]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kernel/params.c: print failure information instead of 'KOBJ_ADD' to user space, when sysfs_create_file() fails.
On 07/11/2013 09:53 AM, Rusty Russell wrote:
> Chen Gang F T <chen.gang.flying.transformer@gmail.com> writes:
>> > On 07/09/2013 04:07 PM, Rusty Russell wrote:
>>> >> Chen Gang <gang.chen@asianux.com> writes:
>>>> >>> When sysfs_create_file() fails, recommend to print the related failure
>>>> >>> information. And it is useless to still 'KOBJ_ADD' to user space.
>>>> >>>
>>>> >>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>>> >>
>>> >> sysfs_create_file() should not fail during boot, should it?
>>> >>
>> >
>> > Hmm..., please reference locate_module_kobject() in "kernel/params.c",
>> > which is an '__init' function, and also call sysfs_create_file(), it
>> > processes the related error.
>> >
>> > So I recommend to get the check too in version_sysfs_builtin().
> It still can't fail. sysfs_create_file() can fail due to OOM (not at
> boot) or name duplication (not here).
>
> You can BUG_ON() if you want.
>

OK, thanks, I will send patch v2 for it.


> And feel free to fix locate_module_kobject() in a separate patch.

OK, thanks, I will send related patch for it.

:-)


Thanks.
--
Chen Gang


\
 
 \ /
  Last update: 2013-07-11 06:01    [W:2.697 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site