From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH v2 net-next 0/7] net: speedup netns create/delete time Date: Wed, 13 Dec 2017 13:52:29 -0800 Message-ID: <1513201949.25033.68.camel@gmail.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Tariq Toukan , "David S . Miller" , netdev , "Eric W . Biederman" , Majd Dibbiny , Yonatan Cohen , Eran Ben Elisha To: Dmitry Torokhov , Eric Dumazet Return-path: Received: from mail-pf0-f193.google.com ([209.85.192.193]:46494 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753737AbdLMVwc (ORCPT ); Wed, 13 Dec 2017 16:52:32 -0500 Received: by mail-pf0-f193.google.com with SMTP id c204so2081759pfc.13 for ; Wed, 13 Dec 2017 13:52:32 -0800 (PST) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: 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--; } }