From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7010687509260664832 X-Received: by 2002:a05:6512:b1b:: with SMTP id w27mr139799lfu.105.1632323711068; Wed, 22 Sep 2021 08:15:11 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:8652:: with SMTP id i18ls592506ljj.1.gmail; Wed, 22 Sep 2021 08:15:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwg8jDifBKda7yyS12tPme1g8zHGfNUsLS9EXlhtb4i236V2L6A5UDamxsE9d+PA1H9Su8W X-Received: by 2002:a2e:131a:: with SMTP id 26mr135169ljt.46.1632323710071; Wed, 22 Sep 2021 08:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632323710; cv=none; d=google.com; s=arc-20160816; b=LfBxWX4506HgqQbjs6d53kOsnNVaxnZ8+1QLd/eoj0rkS9zWhNAwcIT1Qia2X2VrTC NRVeT2P4xBu0U4xCcmWW5bbq088GFAA5hrs5/VlHk0Se9V57TevEtEnUWLdjPVPC4uon B3QDbW637xFPSKj0ksGNqnE9igKGvSZOEl4DVO79bPMHjEBEJQdGoRWIQQ1v5DDOsgzQ UCtN6TNEmkKMzuGk0Mt+ia/J62k848h9cg2EL5I49hT3cB992j272x4yMtxVt5MOuRZE lefwhWnf7QOaFqqhJMa7MrtM61ZjAUEk6TKLnELq394U5DQcXbdiISVysC/Imc9EHOqo 3hew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=+ozHOHxNJqvHQ7vMhoKEHOPn1r3MnJBVjHkEHcKg8qo=; b=oWaR72tut5UM7WezsrGaN3miGzVRp9tInTCpRcX1+cQ1u5P/4mcp411QkB4QGgiilC NumcpSMvVvDpMmLhlD6QhLpFv12LOmFIsdj40g+KD4fGWCtNZCsQGO9RctlmzxnVoq0f pDgmGU4aWx7qzhTltGqbG7ceFnKYsQGNK4lp/5M0DhhuRLBLYM5/JxuuQQ0Io4CCvUZx 1NGW9IPuYfd1xbAzRd202NpOL2U9tRTXDn5/aqxGxlG3GN0FDEC/UhdXm1woE6GtGy9S 5ZP9q9O6toXevTljAFXk4Gmzen3hw80XfRwQyOF3B8YVo9jOXUswdb6Rz77LXHmpr4Vo xBfw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id z21si137512ljn.1.2021.09.22.08.15.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Sep 2021 08:15:09 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 18MFF9kq021071 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 22 Sep 2021 17:15:09 +0200 Received: from md1za8fc.ad001.siemens.net ([167.87.35.234]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 18MFF8Kr001563; Wed, 22 Sep 2021 17:15:08 +0200 Date: Wed, 22 Sep 2021 17:15:07 +0200 From: Henning Schild To: Felix Moessbauer Cc: , Subject: Re: [PATCH 3/4] fix race by serialize rootfs_finalize and do_wic_image Message-ID: <20210922171507.40a81eb3@md1za8fc.ad001.siemens.net> In-Reply-To: <20210922092754.3649703-4-felix.moessbauer@siemens.com> References: <20210922092754.3649703-1-felix.moessbauer@siemens.com> <20210922092754.3649703-4-felix.moessbauer@siemens.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: kwOlbsCnylW5 Am Wed, 22 Sep 2021 11:27:53 +0200 schrieb Felix Moessbauer : > The do_wic_image task requires a mounted buildchroot. > Prior to this patch, the wic_do_mounts task and do_rootfs_finalize > were not ordered. By that, the do_rootfs_finalize task could run > in parallel and unmount the buildchroot. That is not just a mounting issue. The finalize should be done before any imager goes to create an image. Because finalize contains quite a bit of "rm -f". If the actual imager task and finalize have not been serialized, we need to look into that for all our imagers, not just wic. The pattern we use is that imagers usually do addtask _image before do_image after do_image_tools and it is also in ubifs cpiogz ext4 fit container ... We need to touch all of them. Or play a global trick like addtask image_tools after do_rootfs_finalize to catch them all and possibly also catch the ones in layers. Henning > This is now fixed by adding the do_rootfs_finalize as a task > dependency. > > Signed-off-by: Felix Moessbauer > --- > meta/classes/wic-img.bbclass | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/meta/classes/wic-img.bbclass > b/meta/classes/wic-img.bbclass index e495c12..573537c 100644 > --- a/meta/classes/wic-img.bbclass > +++ b/meta/classes/wic-img.bbclass > @@ -147,7 +147,7 @@ python do_wic_image() { > bb.build.exec_func("wic_undo_mounts", d) > bb.utils.unlockfile(lock) > } > -addtask wic_image before do_image after do_image_tools > +addtask wic_image before do_image after do_image_tools > do_rootfs_finalize > wic_do_mounts() { > buildchroot_do_mounts