FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 08-22-2011, 01:51 PM
Milan Broz
 
Default kobj_uevent: Ignore if some listeners cannot handle message

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)

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;
--
1.7.6

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 08-22-2011, 04:24 PM
Kay Sievers
 
Default kobj_uevent: Ignore if some listeners cannot handle message

On Mon, Aug 22, 2011 at 15:51, Milan Broz <mbroz@redhat.com> wrote:
> 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.

> - * * * * * * * * * * * if (retval == -ENOBUFS)
> + * * * * * * * * * * * if (retval == -ENOBUFS || retval == -ESRCH)

Looks good to me.

Kay

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 08-22-2011, 07:49 PM
 
Default kobj_uevent: Ignore if some listeners cannot handle message

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.

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;

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 08-22-2011, 08:05 PM
Milan Broz
 
Default kobj_uevent: Ignore if some listeners cannot handle message

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;

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 09:32 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org