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

Andrey Ryabinin aryabinin at virtuozzo.com
Thu Jul 20 18:49:29 MSK 2017


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 at virtuozzo.com>
Cc: Cyrill Gorcunov <gorcunov at virtuozzo.com>
---
 lib/kobject_uevent.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 */
-- 
2.13.0



More information about the Devel mailing list