From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6631438923266523136 X-Received: by 2002:a5d:64ca:: with SMTP id y10mr2749629wrv.28.1544021571569; Wed, 05 Dec 2018 06:52:51 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:41c5:: with SMTP id o188ls3977976wma.3.gmail; Wed, 05 Dec 2018 06:52:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/UPkVEIzz2ix8+v++J+INJTi/ROsv7b22wW0ySa/bDtcOWeu/1tt4jLjvzOz5gQvxEq3Uan X-Received: by 2002:a1c:1887:: with SMTP id 129-v6mr2601957wmy.3.1544021571031; Wed, 05 Dec 2018 06:52:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544021571; cv=none; d=google.com; s=arc-20160816; b=o7y1TqcIGJ4VBrZTsTJBd1GmvRK4jWAQ1fNO2xuP9+qyDv0iyCvhranZefCU8EaXtV qPzPJEIHW7ldMORJg79rZpTy5fog/bLPRmNgrFv0HRGez0lLR0S0ObjkcXQnaOZJiXOf QfNljkFJZYBUdgOmqHV5iSZ+H8Ldix8PnLQJpwt+J1Dw01gD6CIouZ7YD2l+Ll/l5Jna RYU+CRqqIzVDpGBv/eYccvwEc0I+08i4dbpi216EE8wK00yf108jW8EOamnOM93dh+rE CZsR3mlhuSvBHxdk0hX4RGBt7S9z8dOCLaUG3OnLJurd3XDODlDN6JZ0D48VGOq8gUj+ cC6A== 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:cc:to:subject; bh=KmmyV/DC/2pOodvrXPv8lMHFbjZVUU9yVortex525i4=; b=PX7OuzViXNCBzjzR3usfDBhnmVHmQrzmFYThVGkduzQLZbXOIYlXo9sBFUFUVRMdGJ T2H5Z6g05OFuAwyivUp0uL5MMULnTMjk1yIvkpdKSYfjRmGMgxpPXJOhpUKc2azjH4t/ wZznGRbOOTHsMNbUUIN6dhNoupcf/NDot0bjf4jL/qZwTmUm7taZxhYanmUru3cqhGO7 IbxriKNGYFqoywxvcjrRI+koDukp6qVVCB7JdZEpWQwbJsM+KU69Xn2oQ3phSqbNaBzF GAUaSowhVIy+L4rA57kgHTCBZ0nIZO0NCMSS1KPBTu1Pg7maftBtWLYfW7L0IvMPJv5y XSfA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id k140si510333wmd.2.2018.12.05.06.52.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 06:52:50 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@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 jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@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 wB5EqodP000635 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Dec 2018 15:52:50 +0100 Received: from [139.25.68.37] (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id wB5EqoRT003067; Wed, 5 Dec 2018 15:52:50 +0100 Subject: Re: [PATCH 0/3] umount fixes and cleanups To: "Maxim Yu. Osipov" , isar-users Cc: Cedric Hombourger References: <02edaac4-fc2d-44ea-6471-52ad8fc3d421@siemens.com> <7267182f-b841-0763-9870-833c0ccdfee8@ilbers.de> From: Jan Kiszka Message-ID: <936cda18-e1af-6182-cf10-2f41b0a166e7@siemens.com> Date: Wed, 5 Dec 2018 15:52:49 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <7267182f-b841-0763-9870-833c0ccdfee8@ilbers.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TUID: xUERaEZmdM12 On 05.12.18 15:26, Maxim Yu. Osipov wrote: > On 12/5/18 3:14 PM, Jan Kiszka wrote: >> On 05.12.18 12:12, Maxim Yu. Osipov wrote: >>> On 12/5/18 12:29 PM, Jan Kiszka wrote: >>>> Patches related to resolving the pending CI issues as well as >>>> simplifying the umounts used during cleanup. >>> >>> Tried to run in patch queue: >>> >>> 027b7cf Remove redundant recursive umounts >>> c1bdc33 isar-events: Improve umount handler >>> b354273 ci: Wait for bitbake worker to finish before deleting artifacts >>> 9cf29e6 isar-bootstrap: Fix and cleanup bind mounting >>> b354026 isar-image: umount base-apt when doing offline build >>> e965c0d gitlab-ci: Switch to ci_build.sh >>> ... >>> >>> After execution of problematic test case (I rebooted PC and executed steps in >>> clean tree): >>> >>> my stretch Debian system was entered into unusable state >>> as many important mounts were disappeared (see log of mount points >>> before and after execution  of last command attached). >> >> OK, so I took the time and extracted the root cause. We may see a Debian 4.9 >> kernel bug here: >> >> # mkdir my-mnt >> # mount --rbind /sys my-mnt >> # mount --make-rslave my-mnt >> # umount {-R,-l,-R -l} my-mnt >> # rmdir my-mnt >> rmdir: failed to remove 'my-mnt': Device or resource busy >> >> This works fine on my Leap 15.0 kernel (4.12) as well as the 4.4 kernel >> (Ubuntu) used on our CI server. > > This also works fine on my Debian 4.9 kernel (I've ran this sequence for every > combination of {-R, -l , -R -l}): > >> root@tiberius:~# uname -a >> Linux tiberius 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6 (2018-10-08) >> x86_64 GNU/Linux Hmpf, rechecking... I was still on 3.16 from the jessie that I upgraded from. Works fine with 4.9, indeed. >> root@tiberius:~# mkdir my-mnt >> root@tiberius:~# mount --rbind /sys my-mnt >> root@tiberius:~# mount --make-rslave my-mnt >> root@tiberius:~# umount -R my-mnt/ >> root@tiberius:~# rmdir my-mnt/ >> root@tiberius:~# mkdir my-mnt >> root@tiberius:~# mount --rbind /sys my-mnt >> root@tiberius:~# mount --make-rslave my-mnt >> root@tiberius:~# umount -l my-mnt >> root@tiberius:~# rmdir my-mnt/ >> root@tiberius:~# mkdir my-mnt >> root@tiberius:~# mount --rbind /sys my-mnt >> root@tiberius:~# mount --make-rslave my-mnt >> root@tiberius:~# umount -R -l my-mnt >> root@tiberius:~# rmdir my-mnt/ >> root@tiberius:~# > OK, then bind-mounting itself likely not the root cause, and we need to dig further. Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux