v2_02_147 annotated tag has been created
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dc8010b173dcb7...
Commit: dc8010b173dcb764b805d700c6fd7a50ff941ba7
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2016-03-19 01:14 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2016-03-19 01:14 +0000
annotated tag: v2_02_147 has been created
at dc8010b173dcb764b805d700c6fd7a50ff941ba7 (tag)
tagging 0d4b6bdfc0bfc6939a70bd6ee4b15dad3cae09f5 (commit)
replaces v2_02_146
Release 2.02.147.
Another development release with some minor fixes.
10 files changed, 114 insertions(+), 24 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlbsqC4ACgkQIoGRwVZ+LBdQdwCgpjzDN93H9BM2RmMY1HzCh0+b
9S8An0ZcmWi3V6RWHsEC1zR+ZkCLzJ2g
=EiFD
-----END PGP SIGNATURE-----
Alasdair G Kergon (3):
post-release
report: Use default vg_name field width too.
pre-release
Peter Rajnoha (2):
fsadm: if available, use /proc/self/mountinfo to detect mounted volume
fsadm: use stat to get major:minor pair for non-standard /dev layouts
Zdenek Kabelac (5):
lvconvert: fix error path test
tests: use own PID path for lvmetad checking
tests: update lvconvert test
lvresize: fix stacked resize
tests: stacked resize of thin on raid
8 years, 1 month
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e58d24293f10b6...
Commit: e58d24293f10b6e29825113cadab8aa70099a128
Parent: 0d4b6bdfc0bfc6939a70bd6ee4b15dad3cae09f5
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Sat Mar 19 01:18:28 2016 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Sat Mar 19 01:18:28 2016 +0000
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 54a274a..5482ec4 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.147(2)-git (2016-03-19)
+2.02.148(2)-git (2016-03-19)
diff --git a/VERSION_DM b/VERSION_DM
index 75e9e89..156b4b5 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.120-git (2016-03-19)
+1.02.121-git (2016-03-19)
diff --git a/WHATS_NEW b/WHATS_NEW
index 0db5526..d096a52 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.148 -
+==================================
+
Version 2.02.147 - 19th March 2016
==================================
If available, use /proc/self/mountinfo to detect mounted volume in fsadm.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index ec27a19..9ddf5e1 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.121 -
+==================================
+
Version 1.02.120 - 11th March 2016
==================================
Improve parsing of cache status and report Fail, Error, needs_check, ro.
8 years, 1 month
master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0d4b6bdfc0bfc6...
Commit: 0d4b6bdfc0bfc6939a70bd6ee4b15dad3cae09f5
Parent: 6c10d1f3d95dc0f7ac55fe55be0115a9fc438da5
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Sat Mar 19 01:14:29 2016 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Sat Mar 19 01:14:29 2016 +0000
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 2 +-
WHATS_NEW_DM | 3 ---
4 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index f56f978..54a274a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.147(2)-git (2016-03-11)
+2.02.147(2)-git (2016-03-19)
diff --git a/VERSION_DM b/VERSION_DM
index c66683d..75e9e89 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.121-git (2016-03-11)
+1.02.120-git (2016-03-19)
diff --git a/WHATS_NEW b/WHATS_NEW
index 96023c8..0db5526 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,4 +1,4 @@
-Version 2.02.147 -
+Version 2.02.147 - 19th March 2016
==================================
If available, use /proc/self/mountinfo to detect mounted volume in fsadm.
Fix resize of stacked raid thin data volume (2.02.141).
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 9ddf5e1..ec27a19 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,6 +1,3 @@
-Version 1.02.121 -
-==================================
-
Version 1.02.120 - 11th March 2016
==================================
Improve parsing of cache status and report Fail, Error, needs_check, ro.
8 years, 1 month
master - fsadm: use stat to get major:minor pair for non-standard /dev layouts
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6c10d1f3d95dc0...
Commit: 6c10d1f3d95dc0f7ac55fe55be0115a9fc438da5
Parent: 2879eff86edb944874c7a1bf580b851286c4da46
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Mar 18 15:55:36 2016 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Mar 18 17:21:47 2016 +0100
fsadm: use stat to get major:minor pair for non-standard /dev layouts
If we're using non-standard /dev layout so we can't get the dm-X name
easily, we can't also look at the /sys/blocl/dm-X/dev to get the major:minor
pair. Use "stat" in this case even though it triggers automounts
(but there's no better way for now).
---
scripts/fsadm.sh | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 4dee15c..26be102 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -191,6 +191,13 @@ detect_fs() {
read </sys/block/${RVOLUME#/dev/}/dm/name SYSVOLUME 2>&1 && VOLUME="$DM_DEV_DIR/mapper/$SYSVOLUME"
read </sys/block/${RVOLUME#/dev/}/dev MAJORMINOR 2>&1 || error "Cannot get major:minor for \"$VOLUME\""
;;
+ *)
+ STAT=$(stat --format "MAJOR=%t MINOR=%T" ${RVOLUME}) || error "Cannot get major:minor for \"$VOLUME\""
+ eval $STAT
+ MAJOR=$((0x${MAJOR}))
+ MINOR=$((0x${MINOR}))
+ MAJORMINOR=${MAJOR}:${MINOR}
+ ;;
esac
# use null device as cache file to be sure about the result
# not using option '-o value' to be compatible with older version of blkid
8 years, 1 month
master - fsadm: use stat to get major:minor pair for non-standard /dev layouts
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=301f8a40025d18...
Commit: 301f8a40025d180796ee2ce607c38d32932c2a60
Parent: 2879eff86edb944874c7a1bf580b851286c4da46
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Mar 18 15:55:36 2016 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Mar 18 17:16:18 2016 +0100
fsadm: use stat to get major:minor pair for non-standard /dev layouts
If we're using non-standard /dev layout so we can't get the dm-X name
easily, we can't also look at the /sys/blocl/dm-X/dev to get the major:minor
pair. Use "stat" in this case even though it triggers automounts
(but there's no better way for now).
---
scripts/fsadm.sh | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 4dee15c..6ad5199 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -191,6 +191,14 @@ detect_fs() {
read </sys/block/${RVOLUME#/dev/}/dm/name SYSVOLUME 2>&1 && VOLUME="$DM_DEV_DIR/mapper/$SYSVOLUME"
read </sys/block/${RVOLUME#/dev/}/dev MAJORMINOR 2>&1 || error "Cannot get major:minor for \"$VOLUME\""
;;
+ *)
+ STAT=$(stat --format "MAJOR=%t MINOR=%T" ${RVOLUME}) || error "Cannot get major:minor for \"$VOLUME\""
+ eval $STAT
+ MAJOR=$((0x${MAJOR}))
+ MINOR=$((0x${MINOR}))
+ MAJORMINOR=${MAJOR}:${MINOR}
+ echo "MAJOR:MINOR $MAJORMINOR" >> /a.log
+ ;;
esac
# use null device as cache file to be sure about the result
# not using option '-o value' to be compatible with older version of blkid
8 years, 1 month
master - fsadm: for now, fallback to using /proc/mounts if we're using non-standard /dev layout
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8b48753fa51016...
Commit: 8b48753fa51016b5502b4d4c6c8242b1537694b1
Parent: 2879eff86edb944874c7a1bf580b851286c4da46
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Mar 18 15:55:36 2016 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Mar 18 17:13:03 2016 +0100
fsadm: for now, fallback to using /proc/mounts if we're using non-standard /dev layout
If we're using non-standard /dev layout so we can't get the dm-X name,
we can't also look at the /sys/blocl/dm-X/dev to get the major:minor
pair.
That is this part of the script exactly:
VOLUME=${1/#"${DM_DEV_DIR}/"/}
VOLUME=$("$READLINK" $READLINK_E "$DM_DEV_DIR/$VOLUME") || error "Cannot get readlink \"$1\""
RVOLUME=$VOLUME
case "$RVOLUME" in
# hardcoded /dev since udev does not create these entries elsewhere
/dev/dm-[0-9]*)
read </sys/block/${RVOLUME#/dev/}/dm/name SYSVOLUME 2>&1 && VOLUME="$DM_DEV_DIR/mapper/$SYSVOLUME"
read </sys/block/${RVOLUME#/dev/}/dev MAJORMINOR 2>&1 || error "Cannot get major:minor for \"$VOLUME\""
;;
esac
So if we're not using usual /dev/mapper/name --> /dev/dm-X symlinks, we
won't get the dm-X name and also we won't get the major:minor pair.
This is just a temporary workaround until I find a quick, sane and compatible
way to get the dm-X name and/or major:minor pair with minimal or no deps on
any external utilities, also keeping in mind to not trigger automounts
(e.g. not using "stat").
---
scripts/fsadm.sh | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 4dee15c..6ad5199 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -191,6 +191,14 @@ detect_fs() {
read </sys/block/${RVOLUME#/dev/}/dm/name SYSVOLUME 2>&1 && VOLUME="$DM_DEV_DIR/mapper/$SYSVOLUME"
read </sys/block/${RVOLUME#/dev/}/dev MAJORMINOR 2>&1 || error "Cannot get major:minor for \"$VOLUME\""
;;
+ *)
+ STAT=$(stat --format "MAJOR=%t MINOR=%T" ${RVOLUME}) || error "Cannot get major:minor for \"$VOLUME\""
+ eval $STAT
+ MAJOR=$((0x${MAJOR}))
+ MINOR=$((0x${MINOR}))
+ MAJORMINOR=${MAJOR}:${MINOR}
+ echo "MAJOR:MINOR $MAJORMINOR" >> /a.log
+ ;;
esac
# use null device as cache file to be sure about the result
# not using option '-o value' to be compatible with older version of blkid
8 years, 1 month
master - fsadm: for now, fallback to using /proc/mounts if we're using non-standard /dev layout
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0c88fa77ab022f...
Commit: 0c88fa77ab022f36bcad5751cc30cd8328bc09dc
Parent: 2879eff86edb944874c7a1bf580b851286c4da46
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Mar 18 15:55:36 2016 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Mar 18 15:55:36 2016 +0100
fsadm: for now, fallback to using /proc/mounts if we're using non-standard /dev layout
If we're using non-standard /dev layout so we can't get the dm-X name,
we can't also look at the /sys/blocl/dm-X/dev to get the major:minor
pair.
That is this part of the script exactly:
VOLUME=${1/#"${DM_DEV_DIR}/"/}
VOLUME=$("$READLINK" $READLINK_E "$DM_DEV_DIR/$VOLUME") || error "Cannot get readlink \"$1\""
RVOLUME=$VOLUME
case "$RVOLUME" in
# hardcoded /dev since udev does not create these entries elsewhere
/dev/dm-[0-9]*)
read </sys/block/${RVOLUME#/dev/}/dm/name SYSVOLUME 2>&1 && VOLUME="$DM_DEV_DIR/mapper/$SYSVOLUME"
read </sys/block/${RVOLUME#/dev/}/dev MAJORMINOR 2>&1 || error "Cannot get major:minor for \"$VOLUME\""
;;
esac
So if we're not using usual /dev/mapper/name --> /dev/dm-X symlinks, we
won't get the dm-X name and also we won't get the major:minor pair.
This is just a temporary workaround until I find a quick, sane and compatible
way to get the dm-X name and/or major:minor pair with minimal or no deps on
any external utilities, also keeping in mind to not trigger automounts
(e.g. not using "stat").
---
scripts/fsadm.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 4dee15c..63bedb1 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -236,7 +236,7 @@ detect_mounted_with_proc_mounts() {
# check if the given device is already mounted and where
# FIXME: resolve swap usage and device stacking
detect_mounted() {
- if test -e "$PROCSELFMOUNTINFO"; then
+ if test -e "$PROCSELFMOUNTINFO" && test -n "${MAJORMINOR}"; then
detect_mounted_with_proc_self_mountinfo
elif test -e "$PROCMOUNTS"; then
detect_mounted_with_proc_mounts
8 years, 1 month
master - fsadm: if available, use /proc/self/mountinfo to detect mounted volume
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2879eff86edb94...
Commit: 2879eff86edb944874c7a1bf580b851286c4da46
Parent: 464ebe04db33ac105f5278dbbb244a9f84d582f8
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Mar 18 13:42:06 2016 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Mar 18 13:42:06 2016 +0100
fsadm: if available, use /proc/self/mountinfo to detect mounted volume
The /proc/self/mountinfo is not bound to device names like /proc/mounts
and it uses major:minor pairs instead.
This fixes a situation in which a volume is mounted and then renamed
later on - that makes /proc/mounts unreliable when detecting mounted
volumes.
See also https://bugzilla.redhat.com/show_bug.cgi?id=1196910.
---
WHATS_NEW | 1 +
scripts/fsadm.sh | 29 +++++++++++++++++++++++++----
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index d49e935..96023c8 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.147 -
==================================
+ If available, use /proc/self/mountinfo to detect mounted volume in fsadm.
Fix resize of stacked raid thin data volume (2.02.141).
Fix test for lvremove failure in lvconvert --uncache (2.02.146).
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index fc85988..4dee15c 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -76,6 +76,7 @@ MOUNTPOINT=
MOUNTED=
REMOUNT=
PROCMOUNTS="/proc/mounts"
+PROCSELFMOUNTINFO="/proc/self/mountinfo"
NULL="$DM_DEV_DIR/null"
IFS_OLD=$IFS
@@ -188,6 +189,7 @@ detect_fs() {
# hardcoded /dev since udev does not create these entries elsewhere
/dev/dm-[0-9]*)
read </sys/block/${RVOLUME#/dev/}/dm/name SYSVOLUME 2>&1 && VOLUME="$DM_DEV_DIR/mapper/$SYSVOLUME"
+ read </sys/block/${RVOLUME#/dev/}/dev MAJORMINOR 2>&1 || error "Cannot get major:minor for \"$VOLUME\""
;;
esac
# use null device as cache file to be sure about the result
@@ -198,11 +200,18 @@ detect_fs() {
verbose "\"$FSTYPE\" filesystem found on \"$VOLUME\""
}
-# check if the given device is already mounted and where
-# FIXME: resolve swap usage and device stacking
-detect_mounted() {
- test -e "$PROCMOUNTS" || error "Cannot detect mounted device \"$VOLUME\""
+detect_mounted_with_proc_self_mountinfo() {
+ MOUNTED=$("$GREP" "^[0-9]* [0-9]* $MAJORMINOR " "$PROCSELFMOUNTINFO")
+
+ # extract 5th field which is mount point
+ # echo -e translates \040 to spaces
+ MOUNTED=$(echo ${MOUNTED} | cut -d " " -f 5)
+ MOUNTED=$(echo -n -e ${MOUNTED})
+
+ test -n "$MOUNTED"
+}
+detect_mounted_with_proc_mounts() {
MOUNTED=$("$GREP" "^$VOLUME[ \t]" "$PROCMOUNTS")
# for empty string try again with real volume name
@@ -224,6 +233,18 @@ detect_mounted() {
test -n "$MOUNTED"
}
+# check if the given device is already mounted and where
+# FIXME: resolve swap usage and device stacking
+detect_mounted() {
+ if test -e "$PROCSELFMOUNTINFO"; then
+ detect_mounted_with_proc_self_mountinfo
+ elif test -e "$PROCMOUNTS"; then
+ detect_mounted_with_proc_mounts
+ else
+ error "Cannot detect mounted device \"$VOLUME\""
+ fi
+}
+
# get the full size of device in bytes
detect_device_size() {
# check if blockdev supports getsize64
8 years, 1 month
master - tests: stacked resize of thin on raid
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=464ebe04db33ac...
Commit: 464ebe04db33ac105f5278dbbb244a9f84d582f8
Parent: 51ed48f8551cf32539765b5057bb20cc8d9a8777
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 15 23:16:47 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Mar 15 23:22:52 2016 +0100
tests: stacked resize of thin on raid
---
test/shell/lvextend-thin-raid.sh | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvextend-thin-raid.sh b/test/shell/lvextend-thin-raid.sh
new file mode 100644
index 0000000..7014985
--- /dev/null
+++ b/test/shell/lvextend-thin-raid.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Copyright (C) 2016 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+
+export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
+
+. lib/inittest
+
+aux have_thin 1 0 0 || skip
+aux have_raid 1 3 0 || skip
+
+aux prepare_vg 3
+
+lvcreate --type raid1 -l2 --nosync -n pool $vg
+lvconvert --yes --thinpool $vg/pool "$dev3"
+
+check lv_field $vg/pool seg_size_pe "2"
+check lv_field $vg/pool_tdata seg_size_pe "2" -a
+
+lvextend -l+3 $vg/pool
+
+check lv_field $vg/pool seg_size_pe "5"
+check lv_field $vg/pool_tdata seg_size_pe "5" -a
+
+vgremove -ff $vg
8 years, 1 month
master - lvresize: fix stacked resize
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=51ed48f8551cf3...
Commit: 51ed48f8551cf32539765b5057bb20cc8d9a8777
Parent: 746f8af2a836e662e5588a37feb29c27ed02261b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 15 23:13:28 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Mar 15 23:21:16 2016 +0100
lvresize: fix stacked resize
Commit b64703401da1f4bef60579a0b3766c087fcfe96a cause regression
when handling stacked resize of pool metadata volume that would
be a raid LV.
Fix it by properly setting up size also for layer extension.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 43 ++++++++++++++++++++++++++++---------------
2 files changed, 29 insertions(+), 15 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 23d8787..d49e935 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.147 -
==================================
+ Fix resize of stacked raid thin data volume (2.02.141).
Fix test for lvremove failure in lvconvert --uncache (2.02.146).
Version 2.02.146 - 11th March 2016
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 91a010c..1baf548 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -1704,6 +1704,28 @@ static int _log_parallel_areas(struct dm_pool *mem, struct dm_list *parallel_are
return 1;
}
+/* Handles also stacking */
+static int _setup_lv_size(struct logical_volume *lv, uint32_t extents)
+{
+ struct lv_segment *thin_pool_seg;
+
+ lv->le_count = extents;
+ lv->size = (uint64_t) extents * lv->vg->extent_size;
+
+ if (lv_is_thin_pool_data(lv)) {
+ if (!(thin_pool_seg = get_only_segment_using_this_lv(lv)))
+ return_0;
+
+ /* Update thin pool segment from the layered LV */
+ thin_pool_seg->lv->le_count =
+ thin_pool_seg->len =
+ thin_pool_seg->area_len = lv->le_count;
+ thin_pool_seg->lv->size = lv->size;
+ }
+
+ return 1;
+}
+
static int _setup_alloced_segment(struct logical_volume *lv, uint64_t status,
uint32_t area_count,
uint32_t stripe_size,
@@ -1712,7 +1734,7 @@ static int _setup_alloced_segment(struct logical_volume *lv, uint64_t status,
uint32_t region_size)
{
uint32_t s, extents, area_multiple;
- struct lv_segment *seg, *thin_pool_seg;
+ struct lv_segment *seg;
area_multiple = _calc_area_multiple(segtype, area_count, 0);
extents = aa[0].len * area_multiple;
@@ -1732,19 +1754,9 @@ static int _setup_alloced_segment(struct logical_volume *lv, uint64_t status,
dm_list_add(&lv->segments, &seg->list);
extents = aa[0].len * area_multiple;
- lv->le_count += extents;
- lv->size += (uint64_t) extents * lv->vg->extent_size;
-
- if (lv_is_thin_pool_data(lv)) {
- if (!(thin_pool_seg = get_only_segment_using_this_lv(lv)))
- return_0;
- /* Update thin pool segment from the layered LV */
- thin_pool_seg->lv->le_count =
- thin_pool_seg->len =
- thin_pool_seg->area_len = lv->le_count;
- thin_pool_seg->lv->size = lv->size;
- }
+ if (!_setup_lv_size(lv, lv->le_count + extents))
+ return_0;
return 1;
}
@@ -3875,8 +3887,9 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah,
seg->area_len += extents;
seg->len += extents;
- lv->le_count += extents;
- lv->size += (uint64_t) extents * lv->vg->extent_size;
+
+ if (!_setup_lv_size(lv, lv->le_count + extents))
+ return_0;
/*
* The MD bitmap is limited to being able to track 2^21 regions.
8 years, 1 month