From: Rusty Russell <rusty@rustcorp.com.au>
To: Chen Gang F T <chen.gang.flying.transformer@gmail.com>
Cc: Chen Gang <gang.chen@asianux.com>,
khali@linux-fr.org, David.Woodhouse@intel.com,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kernel/params.c: print failure information instead of 'KOBJ_ADD' to user space, when sysfs_create_file() fails.
Date: Thu, 11 Jul 2013 11:23:30 +0930 [thread overview]
Message-ID: <87k3kx50bp.fsf@rustcorp.com.au> (raw)
In-Reply-To: <51DCC426.3010606@gmail.com>
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.
And feel free to fix locate_module_kobject() in a separate patch.
Cheers,
Rusty.
next prev parent reply other threads:[~2013-07-11 2:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-09 3:37 [PATCH] kernel/params.c: print failure information instead of 'KOBJ_ADD' to user space, when sysfs_create_file() fails Chen Gang
2013-07-09 8:07 ` Rusty Russell
2013-07-10 2:17 ` Chen Gang F T
2013-07-10 2:35 ` Chen Gang
2013-07-10 3:01 ` Chen Gang F T
2013-07-11 23:45 ` Chen Gang
2013-07-11 1:53 ` Rusty Russell [this message]
2013-07-11 2:57 ` Chen Gang
2013-07-11 4:06 ` [PATCH v2] kernel/params.c: add/modify failure processing code " Chen Gang
2013-07-22 2:41 ` Chen Gang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k3kx50bp.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=David.Woodhouse@intel.com \
--cc=chen.gang.flying.transformer@gmail.com \
--cc=gang.chen@asianux.com \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.