[Devel,rh7] kobj, uevent: allow to broadcast event to ve0 from any ve

Submitted by Andrey Ryabinin on July 20, 2017, 3:49 p.m.

Details

Message ID 20170720154929.29857-1-aryabinin@virtuozzo.com
State New
Series "kobj, uevent: allow to broadcast event to ve0 from any ve"
Headers show

Commit Message

Andrey Ryabinin July 20, 2017, 3:49 p.m.
Commit 732eb5c2ac0a ("ve/kobj: Send events per VE instead of
all net-namespaces broadcasting") forbid to send uevents to any another
ve. So when container stumps on FS-corruption and sends uevent about that,
the host uevents won't see it. Let's allow to broadcast any events to
the ve0 from other ve's to fix this

https://jira.sw.ru/browse/PSBM-68710
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Cyrill Gorcunov <gorcunov@virtuozzo.com>
---
 lib/kobject_uevent.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 2ef1e157400..f67dca276e6 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -259,11 +259,13 @@  int kobject_uevent_env_one(struct kobject *kobj, enum kobject_action action,
 		struct sock *uevent_sock = ue_sk->sk;
 		struct sk_buff *skb;
 		size_t len;
+		struct ve_struct *owner_ve;
 
 		if (!netlink_has_listeners(uevent_sock, 1))
 			continue;
 
-		if (sock_net(uevent_sock)->owner_ve != get_exec_env())
+		owner_ve = sock_net(uevent_sock)->owner_ve;
+		if (!ve_is_super(owner_ve) && owner_ve != get_exec_env())
 			continue;
 
 		/* allocate message with the maximum possible size */

Comments

Kirill Gorkunov July 20, 2017, 4:08 p.m.
On Thu, Jul 20, 2017 at 06:49:29PM +0300, Andrey Ryabinin wrote:
> Commit 732eb5c2ac0a ("ve/kobj: Send events per VE instead of
> all net-namespaces broadcasting") forbid to send uevents to any another
> ve. So when container stumps on FS-corruption and sends uevent about that,
> the host uevents won't see it. Let's allow to broadcast any events to
> the ve0 from other ve's to fix this
> 
> https://jira.sw.ru/browse/PSBM-68710
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> Cc: Cyrill Gorcunov <gorcunov@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>