All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: stable-2.02 - tests: check thin-pool corner case allocs
Date: Wed, 13 Jan 2021 10:09:19 +0000 (GMT)	[thread overview]
Message-ID: <20210113100919.F09BE384A01E@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b9d31664dc8272e58c4233d34dcde8ce1447314f
Commit:        b9d31664dc8272e58c4233d34dcde8ce1447314f
Parent:        194630be52b6459b331fcf338539c82263125162
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Tue Jan 12 23:26:16 2021 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Wed Jan 13 10:41:17 2021 +0100

tests: check thin-pool corner case allocs

---
 test/shell/lvcreate-thin-limits.sh | 30 ++++++++++++++++++++++++++----
 1 file changed, 26 insertions(+), 4 deletions(-)

diff --git a/test/shell/lvcreate-thin-limits.sh b/test/shell/lvcreate-thin-limits.sh
index 6a9c33d82..5dcc160dc 100644
--- a/test/shell/lvcreate-thin-limits.sh
+++ b/test/shell/lvcreate-thin-limits.sh
@@ -27,13 +27,35 @@ aux can_use_16T || skip
 aux have_thin 1 0 0 || skip
 which mkfs.ext4 || skip
 
-aux prepare_pvs 1 16777216
+# 16T device
+aux prepare_pvs 2 8388608
 get_devs
 
-vgcreate $SHARED -s 4K "$vg" "${DEVICES[@]}"
+# gives 16777215M device
+vgcreate $SHARED -s 4M "$vg" "${DEVICES[@]}"
 
-not lvcreate -T -L15.995T --poolmetadatasize 5G $vg/pool
+# For 1st. pass only single PV
+lvcreate -l100%PV --name $lv1 $vg "$dev2"
 
-lvs -ao+seg_pe_ranges $vg
+for i in 1 0
+do
+	SIZE=$(get vg_field "$vg" vg_free --units m)
+	SIZE=${SIZE%%\.*}
+
+	# ~16T - 2 * 5G + something  -> should not fit
+	not lvcreate -Zn -T -L$(( SIZE - 2 * 5 * 1024 + 1 )) --poolmetadatasize 5G $vg/pool
+
+	check vg_field "$vg" lv_count "$i"
+
+	# Should fit  data + metadata + pmspare
+	lvcreate -Zn -T -L$(( SIZE - 2 * 5 * 1024 )) --poolmetadatasize 5G $vg/pool
+
+	check vg_field "$vg" vg_free "0"
+
+	lvs -ao+seg_pe_ranges $vg
+
+        # Remove everything for 2nd. pass
+	lvremove -ff $vg
+done
 
 vgremove -ff $vg



                 reply	other threads:[~2021-01-13 10:09 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=20210113100919.F09BE384A01E@sourceware.org \
    --to=zkabelac@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.