From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6530156151538974720 X-Received: by 10.157.45.107 with SMTP id v98mr11671862ota.50.1520420462403; Wed, 07 Mar 2018 03:01:02 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.202.85.78 with SMTP id j75ls208727oib.10.gmail; Wed, 07 Mar 2018 03:01:02 -0800 (PST) X-Google-Smtp-Source: AG47ELtUAMqtIaPD6d+rG4XyYiBDoWFAS+mUoLlqk40873aZlSo+6CL4dmnteHUYLFaSHTclGN3n X-Received: by 10.202.240.3 with SMTP id o3mr11025554oih.121.1520420462082; Wed, 07 Mar 2018 03:01:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520420462; cv=none; d=google.com; s=arc-20160816; b=iWbhbCKZXf8G2cNzP9IjMYnCanbfHS5A6ZNYRn3NcCwZ9MTaSYN740Q3DW0zYfsmCX PM5+l2+28crMZisObNOwRZFVbd3/ECPn2CmG3vpgoamEl3rLtfzD6YPx+Xkse4yxcAgp qO62698WaSzncM1DQhJzNT87kuAhsuRIIAw/SG7k144ZSuGZC/cB5+qjZyHkq0EVKwDS 73Q7EBUj4je60rjN2w3/AoZLDwsU3qqM8jTRVf5jiU9wbURtee8jcjI50YKK9KMWEh/g qD+wKt9fW+dU38uKsyZjHDCrxlqHJUtJsVgi1mHt2r9frX1lzTFuDWGAdhx/bUA5XFC2 FLOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :arc-authentication-results; bh=fWqfTVUzx69/MLfokBOWNVaoeIUQDbh14paaAiJrEyo=; b=tUS+bg3GqCqUGSLooEWGtSs5c3V2BshGax6KiSVSAgxM5LArKv/YFFF8D7kvk2HRyj GQH9YWbyiN9bTq75L+349qKs4SrgfD/oqCTTnk92tSViryaweMP+NF9LAxNz+/ivCttD mIx4fV9zWH4H4zyiHCsplPlDwCpR7IHRIrwv1Hrb+wN5Nivt44v/+Odi0n7W5qbP71rK uzUIa+7JBKtbWJD0my1f2vuyy5LHj9DzaoJGEcW7MDcjZRTobqjGaYSB+0Zyf7EG3zeG ++iRnbcn8MAfGFel3HJzqq4iNX2N/wYkszTqiC5Mau920cq1k9EkuCHZBoXqS31lNZGA XZ2w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Return-Path: Received: from relay1.mentorg.com (relay1.mentorg.com. [192.94.38.131]) by gmr-mx.google.com with ESMTPS id x2si1203142oia.5.2018.03.07.03.01.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 03:01:01 -0800 (PST) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) client-ip=192.94.38.131; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-02.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1etWoe-0000rB-VR from Cedric_Hombourger@mentor.com for isar-users@googlegroups.com; Wed, 07 Mar 2018 03:01:00 -0800 Received: from 8ed3f6b9f02f.anacadf.mentorg.com (137.202.0.87) by svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 7 Mar 2018 11:00:57 +0000 From: Cedric Hombourger To: Subject: [PATCH 1/1] isar-events: try unmounting all mounts before returning an error Date: Wed, 7 Mar 2018 11:00:49 +0000 Message-ID: <20180307110049.43760-2-Cedric_Hombourger@mentor.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180307110049.43760-1-Cedric_Hombourger@mentor.com> References: <20180307110049.43760-1-Cedric_Hombourger@mentor.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [137.202.0.87] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-TUID: 94mvsaojsogv Isar would loop forever if a mount cannot be unmounted because another bind mount was done underneath it (e.g. /sys/devices on top of /sys). Increase of chances of success by trying to unmount everything before returning an error. In the /sys/dev case, we may try /sys first and fail but would continue to unmount /sys/dev. On the following call, only /sys will remain and the unmount_all should now succeed. We may want to implement a timeout: e.g. giveup after 30 tries (i.e. approximately 30 seconds)? Signed-off-by: Cedric Hombourger --- meta/classes/isar-events.bbclass | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meta/classes/isar-events.bbclass b/meta/classes/isar-events.bbclass index 29c7437..b3ce434 100644 --- a/meta/classes/isar-events.bbclass +++ b/meta/classes/isar-events.bbclass @@ -14,14 +14,15 @@ python isar_handler () { # '/proc/mounts' contains all the active mounts, so knowing basepath # we can get the list of mounts for the specific multiconfig and # clean them. + result = True with open('/proc/mounts', 'rU') as f: for line in f: if basepath in line: if subprocess.call('sudo umount ' + line.split()[1], stdout=devnull, stderr=devnull, shell=True) != 0: - return False - return True + result = False + return result devnull = open(os.devnull, 'w') -- 2.11.0