Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753188AbbBSKbE (ORCPT ); Thu, 19 Feb 2015 05:31:04 -0500 Received: from mail-ob0-f172.google.com ([209.85.214.172]:41909 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752515AbbBSKbA convert rfc822-to-8bit (ORCPT ); Thu, 19 Feb 2015 05:31:00 -0500 MIME-Version: 1.0 In-Reply-To: <54E5795C.5050804@mentor.com> References: <1424177796-17923-1-git-send-email-harish_kandiga@mentor.com> <874mqjuaky.fsf@rustcorp.com.au> <87vbiysv1v.fsf@rustcorp.com.au> <54E5795C.5050804@mentor.com> From: Lucas De Marchi Date: Thu, 19 Feb 2015 08:30:40 -0200 Message-ID: Subject: Re: [PATCH] libkmod-module: Remove directory existence check for KMOD_MODULE_BUILTIN To: Harish Jenny Kandiga Nagaraj Cc: Rusty Russell , linux-modules , lkml , greg KH Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1799 Lines: 37 On Thu, Feb 19, 2015 at 3:49 AM, Harish Jenny Kandiga Nagaraj wrote: >> Harrish, in your patch if you just change the "return >> KMOD_MODULE_BUILTIN;" to "return KMOD_MODULE_COMING;" does it work? > > Yes. Returning KMOD_MODULE_COMING instead of KMOD_MODULE_BUILTIN works. The built-in modules are handled by looking at the modules.builtin index file. Is there any chance of returning KMOD_MODULE_COMING for builti-in modules? If it does not have any impact, then the fix should be fine. well... you're not returning KMOD_MODULE_COMING for a builtin module. Having the directory /sys/module/ and not the initstate could be either that the module is builtin or that there's a race while loading the module and it's in the coming state. However since we use the index to decide if this module is builtin in the beginning of this function, here it can only be the second case. However... mod->builtin in the beginning of this function is only set if the module is created by a lookup rather than from name or from path.... maybe here we need to actually fallback to the index rather than the cached value, otherwise this test would fail (considering "vt" is builtin): kmod_module_new_from_name(ctx, "vt", &mod); kmod_module_get_initstate(mod, &state); > Do I need to send a separate patch ? I was hoping it would be a oneliner, but it isn't. If you are going to send a patch, please add the necessary checks for the builtin index. Otherwise I can take a look on this until the end of this week. -- Lucas De Marchi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/