From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH v2 net-next 0/7] net: speedup netns create/delete time Date: Wed, 13 Dec 2017 14:24:49 -0800 Message-ID: References: <20170919232709.14690-1-edumazet@google.com> <8edb310a-562d-bff1-0482-64314833e722@mellanox.com> <266d30e7-5164-48e8-b802-56bb93558823@mellanox.com> <33E69A03-6594-423A-86E6-02029046BE7D@gmail.com> <1513201949.25033.68.camel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Eric Dumazet , Tariq Toukan , "David S . Miller" , netdev , "Eric W . Biederman" , Majd Dibbiny , Yonatan Cohen , Eran Ben Elisha To: Eric Dumazet Return-path: Received: from mail-vk0-f67.google.com ([209.85.213.67]:43863 "EHLO mail-vk0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751088AbdLMWYv (ORCPT ); Wed, 13 Dec 2017 17:24:51 -0500 Received: by mail-vk0-f67.google.com with SMTP id u84so2407543vke.10 for ; Wed, 13 Dec 2017 14:24:50 -0800 (PST) In-Reply-To: <1513201949.25033.68.camel@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Dec 13, 2017 at 1:52 PM, Eric Dumazet wrote: > On Wed, 2017-12-13 at 13:43 -0800, Dmitry Torokhov wrote: >> Hi Eric, >> >> On Thu, Oct 19, 2017 at 7:11 AM, Eric Dumazet wrote: >> > >> > On Thu, Oct 19, 2017 at 4:48 AM, Tariq Toukan wrote: >> > > >> > > Hi Eric, >> > > >> > > I just wanted to check if this is solved already, as I don't want to keep an >> > > unnecessary revert patch in our internal branches. >> > > According to my check bug still exists. >> > > >> > >> > I will handle this today, thanks for the reminder. >> >> Did you have a chance to do this? It looks like the original change >> landed on mainline and causes modules to be autoloaded on KOBJ_UNBIND >> again. >> >> Thanks! > > I sent the following to Tariq, and he tested it successfully. > > I will submit this formally. > > diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c > index c3e84edc47c965d40199b652ba78876cdaa9c70c..0795482b15d5a8f1b65b570a071aa1419cb923d8 100644 > --- a/lib/kobject_uevent.c > +++ b/lib/kobject_uevent.c > @@ -346,19 +346,25 @@ static int kobject_uevent_net_broadcast(struct kobject *kobj, > static void zap_modalias_env(struct kobj_uevent_env *env) > { > static const char modalias_prefix[] = "MODALIAS="; > + size_t offset = 0, len; > int i; > > for (i = 0; i < env->envp_idx;) { > + len = strlen(env->envp[i]) + 1; > if (strncmp(env->envp[i], modalias_prefix, > sizeof(modalias_prefix) - 1)) { > i++; > + offset += len; > continue; > } > > - if (i != env->envp_idx - 1) > + env->buflen -= len; > + if (i != env->envp_idx - 1) { > + memmove(env->envp[i], env->envp[i + 1], > + env->buflen - offset); > memmove(&env->envp[i], &env->envp[i + 1], > sizeof(env->envp[i]) * env->envp_idx - 1); > - > + } > env->envp_idx--; > } > } > As I mentioned in the other thread, that works for netlink, but breaks if you actually using env->envp pointers, as they also need to be adjusted. I have a patch that fixes it properly. Thanks! -- Dmitry