Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dc8010b173dcb764…
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
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6c10d1f3d95dc0f7…
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
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=301f8a40025d1807…
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
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8b48753fa51016b5…
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
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0c88fa77ab022f36…
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
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2879eff86edb9448…
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
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=464ebe04db33ac10…
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