From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6487873763254730752 X-Received: by 10.25.26.147 with SMTP id a141mr615071lfa.30.1510584481052; Mon, 13 Nov 2017 06:48:01 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.25.80 with SMTP id p77ls4150141lje.1.gmail; Mon, 13 Nov 2017 06:48:00 -0800 (PST) X-Google-Smtp-Source: ABhQp+RXEr/4Wqk7ViZSLoEwvgFhCsu8B0fa+EdzEW1U8GHhZSeG0m+HeoL62uWGfs6ruFv8MOG9 X-Received: by 10.46.34.4 with SMTP id i4mr817733lji.17.1510584480594; Mon, 13 Nov 2017 06:48:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510584480; cv=none; d=google.com; s=arc-20160816; b=f6KFqNIq1EYxJ8X9N9cB5aVhPu40GxEX9SkpkRcXMMvata5XAzB1RdirPwO7k39AMc xr0o2xMnLQo92l1kfMtr0blChHpGxRwprWU62xLqi/tW3u9V6qrpvzn0tqLEmRrZzHUz WecauzOUoQQnyvgFR8GN1uwcYQgku/b4f8cEFeAFpPSxsOKOqmJHOHtNvgFW6Vg+uv/E 8/CC9m3B75dQbJSAQTFirI2JprNz+zHg3pUhDFF6QaRb+VT+URzaCpjXEhOS9GHOOY0H 7q5Zk1aMpA169lT8vqVNDEFmuWlNA5hRx1cOaAKuCetivyUJdJSXaQcHlhNAdfWOLZ2t KoLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :arc-authentication-results; bh=7FqYJNOl//uZ6e09FP17Ao83aSdLiqsfUrR8plESGPw=; b=pADiLG8SPOnQFaFaBzprDNqwU0g/kb1h3ErxQ8+1xkS4FTTs0U3Z71tYJyJbMyPHf/ qZR2JhXhEE4XtULUHVso6pfUy73M/YLtj6h4QrxEHa4W9KEt5LbMqtEAsCS9XrjVKhbq y/rTp9VQ1MoKfC0ZcICNPUMM7oSGsLRuGkqxR1RqwycJBIzUyJksiZCqnQYkm+6IdRfx zVydjkE8FtYOGtKguil2/yu+mj7N8xna7G3F5UHUNXIVMH1sqA/L+kKaQodL8QRv1nk8 TYp8Plgcd/t4TT3rkO09w8T9cK0xJOahgKore6YAB25K47+C3320Z6FQJBOztcqo42Eg wYGw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id w29si1343247lfc.1.2017.11.13.06.48.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2017 06:48:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from [10.0.2.15] ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id vADElu89005718 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Mon, 13 Nov 2017 15:47:58 +0100 Subject: Re: [PATCH] isar-image-base: fix some dangling mounts To: isar-users@googlegroups.com References: <20171113142443.hczmlzhnlligt62m@MD1KR9XC.ww002.siemens.net> From: Alexander Smirnov Message-ID: <176ee2a2-7f5b-8395-80c8-ca4df6ecf952@ilbers.de> Date: Mon, 13 Nov 2017 17:47:51 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171113142443.hczmlzhnlligt62m@MD1KR9XC.ww002.siemens.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: 2ToFhel9TyDh On 11/13/2017 05:24 PM, Christian Storm wrote: >> [...] >> Here I see that you insert quite similar patterns across the Isar code, >> would it be better to have one global clean up function like? >> >> do_isar_mount_cleanup () { >> if [ -d "${WORKDIR}/mnt" ]; then >> # umount and remove >> fi >> >> if [ -d "${WORKDIR}/rootfs/proc" ]; then >> # umount and remove >> fi >> >> if [ -d "${BUILDCHROOT_DIR}/proc" ]; then >> # umount and remove >> fi >> >> etc... >> } >> >> This approach will significantly simplify maintenance of clean up traps >> and adding of new possible mounts to Isar. What do you think? > > I'd say it depends :) > It breaks if you rely on keeping something mounted while executing a > child script that does unmount everything, following your proposal. If > we can make sure that such a situation never occurs, we may consolidate > this. For now, it's rather local just undoing the mounts done in the > scope of the script. > So, in the end, I think it's a matter of taste and contracts between the > different parts of Isar. > Ok. > What one may consider to "de-duplicate" is a stack of mounted directories > being pushed to and unmounted on script exit. So, something like > push_umount ${IMAGE_ROOTFS}/proc > and then the EXIT trap enumerates all those entries, unmounting them. > The same has to be done for removing the directories, if applicable. This sounds reasonable, will try to implement this? BTW: for me it's not the point for me to block current patch, it'd be very helpful to have it in the tree now. Alex