From: <mark.jonas@de.bosch.com>
To: <openembedded-core@lists.openembedded.org>
Cc: <bluca@debian.org>, <luca.boccassi@microsoft.com>,
<matt.hoosier@garmin.com>, <richard.purdie@linuxfoundation.org>,
<mark.jonas@de.bosch.com>,
Ricardo Simoes <ricardo.simoes@pt.bosch.com>
Subject: [PATCH 2/2] volatile-binds: Remove workdir if OverlayFS fails
Date: Thu, 18 Jul 2024 08:46:34 +0200 [thread overview]
Message-ID: <20240718064634.7276-3-mark.jonas@de.bosch.com> (raw)
In-Reply-To: <20240718064634.7276-1-mark.jonas@de.bosch.com>
From: Ricardo Simoes <ricardo.simoes@pt.bosch.com>
To fulfill OverlayFS workdir requirements, the mount-copybind script
creates a workdir. But if the mount operation fails for any reason,
the workdir is left there.
Then, subsequent runs of mount-copybind will again try to
create the directory and pollute system logs with failed mkdir error
messages.
This commit mitigates the problem by unconditionally removing workdir
if the OverlayFS is not used or fails to run.
Signed-off-by: Ricardo Simoes <ricardo.simoes@pt.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
---
meta/recipes-core/volatile-binds/files/mount-copybind | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/recipes-core/volatile-binds/files/mount-copybind b/meta/recipes-core/volatile-binds/files/mount-copybind
index da88d160ee..4f373412be 100755
--- a/meta/recipes-core/volatile-binds/files/mount-copybind
+++ b/meta/recipes-core/volatile-binds/files/mount-copybind
@@ -57,6 +57,7 @@ if [ -d "$mountpoint" ]; then
fi
fi
if [ "$MOUNT_COPYBIND_AVOID_OVERLAYFS" = 1 ] || ! mount -t overlay overlay -olowerdir="$mountpoint",upperdir="$spec",workdir="$overlay_workdir""$mountcontext" "$mountpoint" > /dev/null 2>&1; then
+ rm -rf "$overlay_workdir"
if [ "$specdir_existed" != "yes" ]; then
cp -aPR "$mountpoint"/. "$spec/"
--
2.25.1
prev parent reply other threads:[~2024-07-18 6:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-18 6:46 [PATCH 0/2] volatile-binds: Mitigate workdir cleanup issues mark.jonas
2024-07-18 6:46 ` [PATCH 1/2] volatile-binds: Do not create workdir if OverlayFS is disabled mark.jonas
2024-07-18 6:46 ` mark.jonas [this message]
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=20240718064634.7276-3-mark.jonas@de.bosch.com \
--to=mark.jonas@de.bosch.com \
--cc=bluca@debian.org \
--cc=luca.boccassi@microsoft.com \
--cc=matt.hoosier@garmin.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=ricardo.simoes@pt.bosch.com \
--cc=richard.purdie@linuxfoundation.org \
/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