From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: stable-2.02 - thin: compensate metadata size by extra percent
Date: Fri, 16 Oct 2020 19:11:12 +0000 (GMT) [thread overview]
Message-ID: <20201016191112.2B46B396EC83@sourceware.org> (raw)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6b1f67da0699d408477b6cdd79cdd34f8b4b98cd
Commit: 6b1f67da0699d408477b6cdd79cdd34f8b4b98cd
Parent: e5066339a5c61c5d5e8cd365071526cdd07ec04c
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Fri Sep 11 13:31:55 2020 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Fri Oct 16 17:07:58 2020 +0200
thin: compensate metadata size by extra percent
When using --use-policy for automatic extension of thin-pool,
the extension of thin-pool's metadata itself can actually take
some extra space.
Since I'm not aware of exact compensation formula, add just
1% extra to calculated amount and hope it fits.
Wanted target is to always have usable thin-pool that fits
bellow pool_metadata_min_threshold().
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 86c0274b3..c902ccde5 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.188 -
==================================
+ Use extra 1% when resizing thin-pool metadata LV with --use-policy.
Enhance --use-policy percentage rounding.
Switch code base to use flexible array syntax.
Preserve uint32_t for seqno handling.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index affce9433..74b2afa96 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4724,7 +4724,9 @@ static int _lvresize_adjust_policy(const struct logical_volume *lv,
min_threshold = pool_metadata_min_threshold(first_seg(lv)) / DM_PERCENT_1;
*meta_amount = _adjust_amount(percent, (min_threshold < policy_threshold) ?
min_threshold : policy_threshold, policy_amount);
-
+ if (*meta_amount)
+ /* Compensate possible extra space consumption by kernel on resize */
+ (*meta_amount)++;
if (!lv_thin_pool_percent(lv, 0, &percent))
return_0;
} else {
reply other threads:[~2020-10-16 19:11 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=20201016191112.2B46B396EC83@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.