Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261175AbUKRVNr (ORCPT ); Thu, 18 Nov 2004 16:13:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261153AbUKRVMQ (ORCPT ); Thu, 18 Nov 2004 16:12:16 -0500 Received: from mail-ex.suse.de ([195.135.220.2]:21928 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S261201AbUKRVKO (ORCPT ); Thu, 18 Nov 2004 16:10:14 -0500 Date: Thu, 18 Nov 2004 20:05:59 +0100 Message-ID: From: Takashi Iwai To: Johannes Stezenbach Cc: Rusty Russell , lkml - Kernel Mailing List , Gerd Knorr Subject: Re: modprobe + request_module() deadlock In-Reply-To: <20041118135522.GA16910@linuxtv.org> References: <20041117222949.GA9006@linuxtv.org> <1100749702.5865.39.camel@localhost.localdomain> <20041118135522.GA16910@linuxtv.org> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 MULE XEmacs/21.4 (patch 15) (Security Through Obscurity) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1510 Lines: 41 At Thu, 18 Nov 2004 14:55:22 +0100, Johannes Stezenbach wrote: > > On Thu, Nov 18, 2004 at 02:48:22PM +1100, Rusty Russell wrote: > > On Wed, 2004-11-17 at 23:29 +0100, Johannes Stezenbach wrote: > > > Hi, > > > > > > it seems that modprobe in newer versions of module-init-tools > > > (here: 3.1-pre6) gets an exclusive lock on the module's .ko file: > > > > > > struct flock lock; > > > lock.l_type = F_WRLCK; > > > lock.l_whence = SEEK_SET; > > > lock.l_start = 0; > > > lock.l_len = 1; > > > fcntl(fd, F_SETLKW, &lock); > > > > > > This leads to a deadlock when the loaded module calls > > > request_module() in its module_init() function, to load > > > a module which in turn depends on the first module. > > > > My bug, I think. Does this help? > > Yes and no. The deadlock is gone, but now I get: IIRC, request_module() in module_init() doesn't work any more in general. A weak linking like i2c doesn't provide the module dependency, so modprobe can't load it by itself, so far. I see the same problem in ALSA snd-powermac module. Can we add a module dependency manually somehow? -- Takashi Iwai ALSA Developer - www.alsa-project.org - 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/