Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752402AbZFTTUf (ORCPT ); Sat, 20 Jun 2009 15:20:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750758AbZFTTU0 (ORCPT ); Sat, 20 Jun 2009 15:20:26 -0400 Received: from mail-fx0-f214.google.com ([209.85.220.214]:49319 "EHLO mail-fx0-f214.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750743AbZFTTUZ (ORCPT ); Sat, 20 Jun 2009 15:20:25 -0400 MIME-Version: 1.0 In-Reply-To: <4A3AE162.7040407@gmail.com> References: <4A38F229.70504@ahsoftware.de> <4A3AE162.7040407@gmail.com> From: Kay Sievers Date: Sat, 20 Jun 2009 21:20:11 +0200 Message-ID: Subject: Re: asynchronous calls an the lack of --wait-for-completion options (e.g. modprobe, losetup, cryptsetup) To: Robert Hancock Cc: Alexander Holler , linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 961 Lines: 24 On Fri, Jun 19, 2009 at 02:52, Robert Hancock wrote: > On 06/17/2009 07:39 AM, Alexander Holler wrote: >> The problem is that when I'm e.g. calling modprobe loop, loop might not >> has finished it's initialization, when modprobe returns. > > It will have. Just that udev won't have received the events and created the > device node yet. So the solution would likely be on the udev side.. The brutal method to do this is to call: udevadm settle after loading the module. It will block until all currently pending events for udev are fully handled. Recent udevadm versions also have a: --exit-if-exists= option, which will make "settle" stop waiting if a given file exists. Kay -- 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/