From: David Teigland <teigland@sourceware.org>
To: lvm-devel@redhat.com
Subject: dev-next - tests: aux clean DM on top of MD
Date: Wed, 31 Mar 2021 21:49:01 +0000 (GMT) [thread overview]
Message-ID: <20210331214901.CFA833857C6F@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=dd1f5f9a24fc906de7e6dd064ecdd8fdfa9eebda
Commit: dd1f5f9a24fc906de7e6dd064ecdd8fdfa9eebda
Parent: 93f2d194aca4a589cd38dd8bdd99cad2945dd21c
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Tue Mar 23 21:28:28 2021 +0100
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Mar 23 21:28:28 2021 +0100
tests: aux clean DM on top of MD
Before cleaning MD, try to remove any DM on top such MD.
Check is made through DM table check.
Maybe parse /proc/mdstat for this???
---
test/lib/aux.sh | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 386918041..08eeac55b 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -783,11 +783,21 @@ cleanup_md_dev() {
mddev=$(< MD_DEV)
base=$(basename "$mddev")
+ # try to find and remove any DM device on top of cleaned MD
+ # assume /dev/mdXXX is 9:MINOR
+ local minor=${mddev##/dev/md}
+ for i in $(dmsetup table | grep 9:$minor | cut -d: -f1) ; do
+ dmsetup remove $i || {
+ dmsetup --force remove $i || true
+ }
+ done
+
for i in {0..10} ; do
grep -q "$base" /proc/mdstat || break
test "$i" = 0 || {
sleep .1
echo "$mddev is still present, stopping again"
+ cat /proc/mdstat
}
mdadm --stop "$mddev" || true
udev_wait # wait till events are process, not zeroing to early
reply other threads:[~2021-03-31 21:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210331214901.CFA833857C6F@sourceware.org \
--to=teigland@sourceware.org \
--cc=lvm-devel@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.