From: Jan Kiszka <jan.kiszka@web.de>
To: "Maxim Yu. Osipov" <mosipov@ilbers.de>,
isar-users <isar-users@googlegroups.com>,
Henning Schild <henning.schild@siemens.com>
Cc: Cedric Hombourger <Cedric_Hombourger@mentor.com>
Subject: Re: [PATCH 0/3] umount fixes and cleanups
Date: Thu, 6 Dec 2018 00:08:51 +0100 [thread overview]
Message-ID: <0ddc2307-4095-0656-140a-7f4b10ae6722@web.de> (raw)
In-Reply-To: <936cda18-e1af-6182-cf10-2f41b0a166e7@siemens.com>
On 05.12.18 15:52, [ext] Jan Kiszka wrote:
> 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.
>
Here is the real solution, or at least a much better workaround, without
any reverts:
diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
index 225463e..c66d208 100644
--- a/meta/classes/wic-img.bbclass
+++ b/meta/classes/wic-img.bbclass
@@ -90,7 +90,7 @@ do_wic_image() {
for dir in ${BBLAYERS} ${STAGING_DIR} ${ISARROOT}/scripts; do
sudo mkdir -p ${BUILDCHROOT_DIR}/$dir
mountpoint ${BUILDCHROOT_DIR}/$dir >/dev/null 2>&1 \
- || sudo mount --bind $dir ${BUILDCHROOT_DIR}/$dir
+ || sudo mount --bind --make-private $dir ${BUILDCHROOT_DIR}/$dir
done
export FAKEROOTCMD=${FAKEROOTCMD}
export BUILDDIR=${BUILDDIR}
I'll explain tomorrow, also what else is broken in do_wic_image.
Jan
next prev parent reply other threads:[~2018-12-05 23:08 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 9:29 Jan Kiszka
2018-12-05 9:29 ` [PATCH 1/3] ci: Wait for bitbake worker to finish before deleting artifacts Jan Kiszka
2018-12-05 9:52 ` Hombourger, Cedric
2018-12-05 9:59 ` Maxim Yu. Osipov
2018-12-05 10:04 ` Jan Kiszka
2018-12-05 9:29 ` [PATCH 2/3] isar-events: Improve umount handler Jan Kiszka
2018-12-05 9:29 ` [PATCH 3/3] Remove redundant recursive umounts Jan Kiszka
2018-12-05 11:12 ` [PATCH 0/3] umount fixes and cleanups Maxim Yu. Osipov
2018-12-05 11:32 ` Hombourger, Cedric
2018-12-05 12:14 ` Jan Kiszka
2018-12-05 12:31 ` Hombourger, Cedric
2018-12-05 12:35 ` Jan Kiszka
2018-12-05 12:48 ` Hombourger, Cedric
2018-12-05 12:54 ` Jan Kiszka
2018-12-05 14:26 ` Maxim Yu. Osipov
2018-12-05 14:52 ` Jan Kiszka
2018-12-05 23:08 ` Jan Kiszka [this message]
2018-12-07 13:46 ` Maxim Yu. Osipov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0ddc2307-4095-0656-140a-7f4b10ae6722@web.de \
--to=jan.kiszka@web.de \
--cc=Cedric_Hombourger@mentor.com \
--cc=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=mosipov@ilbers.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox