From: Milan Broz <mbroz@redhat.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-kernel@vger.kernel.org, dm-devel@redhat.com,
kay.sievers@vrfy.org, greg@kroah.com
Subject: Re: [PATCH] kobj_uevent: Ignore if some listeners cannot handle message
Date: Mon, 22 Aug 2011 22:05:35 +0200 [thread overview]
Message-ID: <4E52B68F.9020004@redhat.com> (raw)
In-Reply-To: <m1hb59w7k0.fsf@fess.ebiederm.org>
On 08/22/2011 09:49 PM, Eric W. Biederman wrote:
> Milan Broz <mbroz@redhat.com> writes:
>
>> kobject_uevent() uses a multicast socket and should ignore
>> if one of listeners cannot handle messages or nobody is
>> listening at all.
>>
>> Easily reproducible when a process in system is cloned
>> with CLONE_NEWNET flag.
>>
>> (See also
>> http://article.gmane.org/gmane.linux.kernel.device-mapper.dm-crypt/5256)
>
> I am fine with the patch below.
>
> However if you are fine with the patch below let's just remove the
> return code from code from kobject_uevent_env. We are now explicitly
> ignoring all of the possible return codes from
> netlink_broadcast_filtered.
Until someone adds a new errno there, I think ESRCH appeared there
the same way:-)
I think the code is better readable now. Whatever, I do not care,
patch is intended to be minimalistic (perhaps for stable series as well now).
Thanks,
Milan
>
> Ignoring all of the return codes from netlink_broadcast_filtered ignores
> all of the expected errors from kobject_uevent_env, short of programmer
> error.
>
> So why have an error code on kobject_uevent_env?
>
>> Signed-off-by: Milan Broz <mbroz@redhat.com>
>> ---
>> lib/kobject_uevent.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
>> index 70af0a7..ad72a03 100644
>> --- a/lib/kobject_uevent.c
>> +++ b/lib/kobject_uevent.c
>> @@ -282,7 +282,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
>> kobj_bcast_filter,
>> kobj);
>> /* ENOBUFS should be handled in userspace */
>> - if (retval == -ENOBUFS)
>> + if (retval == -ENOBUFS || retval == -ESRCH)
>> retval = 0;
>> } else
>> retval = -ENOMEM;
next prev parent reply other threads:[~2011-08-22 20:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-18 9:45 clone() with CLONE_NEWNET breaks kobject_uevent_env() Milan Broz
2011-08-19 7:52 ` Milan Broz
2011-08-19 9:13 ` [dm-devel] " Eric W. Biederman
2011-08-19 10:22 ` Milan Broz
2011-08-19 11:43 ` Eric W. Biederman
2011-08-19 11:59 ` Milan Broz
2011-08-19 18:39 ` Eric W. Biederman
2011-08-19 20:41 ` Milan Broz
2011-08-22 13:51 ` [PATCH] kobj_uevent: Ignore if some listeners cannot handle message Milan Broz
2011-08-22 16:24 ` Kay Sievers
2011-08-22 19:49 ` Eric W. Biederman
2011-08-22 20:05 ` Milan Broz [this message]
2011-08-19 10:26 ` [dm-devel] clone() with CLONE_NEWNET breaks kobject_uevent_env() Kay Sievers
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=4E52B68F.9020004@redhat.com \
--to=mbroz@redhat.com \
--cc=dm-devel@redhat.com \
--cc=ebiederm@xmission.com \
--cc=greg@kroah.com \
--cc=kay.sievers@vrfy.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome