import lvm2-2.03.09-3.el8

This commit is contained in:
CentOS Sources 2020-07-28 09:58:46 -04:00 committed by Stepan Oksanichenko
parent 69b575edd9
commit 7cccc6ff12
18 changed files with 14507 additions and 27 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/LVM2.2.03.07.tgz
SOURCES/LVM2.2.03.09.tgz

View File

@ -1 +1 @@
a518f89776180548cd0b10ce5e272ae9274e2935 SOURCES/LVM2.2.03.07.tgz
15a90d5039a2a1e9f67611a2a6c2faa72e8996aa SOURCES/LVM2.2.03.09.tgz

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,210 @@
From f540a18fd7f5f65599a6c85c0bd3ba84e54f1cc8 Mon Sep 17 00:00:00 2001
From: Marian Csontos <mcsontos@redhat.com>
Date: Thu, 28 May 2020 18:02:16 +0200
Subject: [PATCH] Merge master up to commit be61bd6ff5c6
---
VERSION | 2 +-
VERSION_DM | 2 +-
test/shell/cache-single-usage.sh | 13 +++++++++++++
test/shell/integrity-dmeventd.sh | 8 ++++++++
test/shell/integrity-large.sh | 8 ++++++++
test/shell/integrity-misc.sh | 8 ++++++++
test/shell/integrity.sh | 8 ++++++++
test/shell/thin-foreign-repair.sh | 14 ++++++++++----
tools/lvconvert.c | 15 +++++++++++++++
9 files changed, 72 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index 00618e0..9ad7a70 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.03.09(2)-RHEL8 (2020-04-21)
+2.03.09(2)-RHEL8 (2020-05-28)
diff --git a/VERSION_DM b/VERSION_DM
index b9ec43e..bcd97de 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.171-RHEL8 (2020-04-21)
+1.02.171-RHEL8 (2020-05-28)
diff --git a/test/shell/cache-single-usage.sh b/test/shell/cache-single-usage.sh
index a885bf7..8936aa3 100644
--- a/test/shell/cache-single-usage.sh
+++ b/test/shell/cache-single-usage.sh
@@ -127,4 +127,17 @@ umount "$mount_dir"
lvchange -an $vg/$lv1
lvchange -an $vg/$lv2
+# misc tests
+
+lvremove $vg
+
+lvcreate -n $lv1 -l 2 -an $vg "$dev1"
+lvcreate -n $lv2 -l 2 -an $vg "$dev1"
+lvcreate -n $lv3 -l 2 -an $vg "$dev2"
+
+lvconvert -y --type writecache --cachevol $lv3 $vg/$lv1
+not lvconvert -y --type writecache --cachevol ${lv3}_cvol $vg/$lv2
+not lvconvert -y --type cache --cachevol ${lv3}_cvol $vg/$lv2
+not lvconvert -y --type cache --cachepool ${lv3}_cvol $vg/$lv2
+
vgremove -ff $vg
diff --git a/test/shell/integrity-dmeventd.sh b/test/shell/integrity-dmeventd.sh
index ed2436a..296f556 100644
--- a/test/shell/integrity-dmeventd.sh
+++ b/test/shell/integrity-dmeventd.sh
@@ -109,6 +109,14 @@ _wait_recalc() {
sleep 1
done
+ # TODO: There is some strange bug, first leg of RAID with integrity
+ # enabled never gets in sync. I saw this in BB, but not when executing
+ # the commands manually
+ if test -z "$sync"; then
+ echo "TEST WARNING: Resync of dm-integrity device '$checklv' failed"
+ dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
+ exit
+ fi
echo "timeout waiting for recalc"
return 1
}
diff --git a/test/shell/integrity-large.sh b/test/shell/integrity-large.sh
index 7a333c1..5aba80e 100644
--- a/test/shell/integrity-large.sh
+++ b/test/shell/integrity-large.sh
@@ -95,6 +95,14 @@ _wait_recalc() {
sleep 1
done
+ # TODO: There is some strange bug, first leg of RAID with integrity
+ # enabled never gets in sync. I saw this in BB, but not when executing
+ # the commands manually
+ if test -z "$sync"; then
+ echo "TEST WARNING: Resync of dm-integrity device '$checklv' failed"
+ dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
+ exit
+ fi
echo "timeout waiting for recalc"
return 1
}
diff --git a/test/shell/integrity-misc.sh b/test/shell/integrity-misc.sh
index a176f18..0d05689 100644
--- a/test/shell/integrity-misc.sh
+++ b/test/shell/integrity-misc.sh
@@ -109,6 +109,14 @@ _wait_recalc() {
sleep 1
done
+ # TODO: There is some strange bug, first leg of RAID with integrity
+ # enabled never gets in sync. I saw this in BB, but not when executing
+ # the commands manually
+ if test -z "$sync"; then
+ echo "TEST WARNING: Resync of dm-integrity device '$checklv' failed"
+ dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
+ exit
+ fi
echo "timeout waiting for recalc"
return 1
}
diff --git a/test/shell/integrity.sh b/test/shell/integrity.sh
index 6baccf0..77e9430 100644
--- a/test/shell/integrity.sh
+++ b/test/shell/integrity.sh
@@ -204,6 +204,14 @@ _wait_recalc() {
sleep 1
done
+ # TODO: There is some strange bug, first leg of RAID with integrity
+ # enabled never gets in sync. I saw this in BB, but not when executing
+ # the commands manually
+ if test -z "$sync"; then
+ echo "TEST WARNING: Resync of dm-integrity device '$checklv' failed"
+ dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
+ exit
+ fi
echo "timeout waiting for recalc"
return 1
}
diff --git a/test/shell/thin-foreign-repair.sh b/test/shell/thin-foreign-repair.sh
index 8b4018e..55e9f62 100644
--- a/test/shell/thin-foreign-repair.sh
+++ b/test/shell/thin-foreign-repair.sh
@@ -17,9 +17,15 @@ SKIP_WITH_LVMPOLLD=1
. lib/inittest
+clean_thin_()
+{
+ aux udev_wait
+ dmsetup remove "$THIN" || { sleep .5 ; dmsetup remove "$THIN" ; }
+}
+
cleanup_mounted_and_teardown()
{
- dmsetup remove $THIN || true
+ clean_thin_ || true
vgremove -ff $vg
aux teardown
}
@@ -56,9 +62,7 @@ dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/mapper/$POOL 0"
mkfs.ext4 "$DM_DEV_DIR/mapper/$THIN"
-aux udev_wait
-
-dmsetup remove "$THIN" || { sleep .5 ; dmsetup remove "$THIN" }
+clean_thin_
lvchange -an $vg/pool
@@ -72,3 +76,5 @@ lvchange -ay $vg/pool
dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/mapper/$POOL 0"
fsck -n "$DM_DEV_DIR/mapper/$THIN"
+
+# exit calls cleanup_mounted_and_teardown
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index cf93538..8652252 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4264,6 +4264,11 @@ static int _lvconvert_cachevol_attach_single(struct cmd_context *cmd,
goto out;
}
+ if (lv_is_cache_vol(cachevol_lv)) {
+ log_error("LV %s is already used as a cachevol.", display_lvname(cachevol_lv));
+ goto out;
+ }
+
/* Ensure the LV is not active elsewhere. */
if (!lockd_lv(cmd, lv, "ex", 0))
goto_out;
@@ -4347,6 +4352,11 @@ static int _lvconvert_cachepool_attach_single(struct cmd_context *cmd,
goto out;
}
+ if (lv_is_cache_vol(cachepool_lv)) {
+ log_error("LV %s is already used as a cachevol.", display_lvname(cachepool_lv));
+ goto out;
+ }
+
if (cachepool_lv == lv) {
log_error("Use a different LV for cache pool LV and cache LV %s.",
display_lvname(cachepool_lv));
@@ -5629,6 +5639,11 @@ static int _lvconvert_writecache_attach_single(struct cmd_context *cmd,
goto bad;
}
+ if (lv_is_cache_vol(lv_fast)) {
+ log_error("LV %s is already used as a cachevol.", display_lvname(lv_fast));
+ goto bad;
+ }
+
/*
* To permit this we need to check the block size of the fs using lv
* (recently in libblkid) so that we can use a matching writecache
--
1.8.3.1

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
From 48105f492f7f8c157ba714217ae55c6fb50e76c0 Mon Sep 17 00:00:00 2001
From: Maxim Plotnikov <wgh@torlan.ru>
Date: Wed, 22 Apr 2020 00:16:29 +0300
Subject: [PATCH] Fix scripts/lvmlocks.service.in using nonexistent --lock-opt
autowait
The --lock-opt autowait was dropped back in 9ab6bdce01,
and attempting to specify it has quite an opposite effect:
no waiting is done, which makes the unit almost useless.
(cherry picked from commit a509776588a5c0c0bfc2394e4d1ed717531b0257)
---
scripts/lvmlocks.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/lvmlocks.service.in b/scripts/lvmlocks.service.in
index f6a951f..a3d0bd4 100644
--- a/scripts/lvmlocks.service.in
+++ b/scripts/lvmlocks.service.in
@@ -8,7 +8,7 @@ Type=oneshot
RemainAfterExit=yes
# start lockspaces and wait for them to finish starting
-ExecStart=@SBINDIR@/lvm vgchange --lock-start --lock-opt autowait
+ExecStart=@SBINDIR@/lvm vgchange --lock-start --lock-opt auto
# stop lockspaces and wait for them to finish stopping
ExecStop=@SBINDIR@/lvmlockctl --stop-lockspaces --wait 1
--
1.8.3.1

View File

@ -0,0 +1,24 @@
From a08afc8d0d18b2547176e731852b816df76c63eb Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Wed, 15 Apr 2020 11:04:12 -0500
Subject: [PATCH 3/3] WHATS_NEW: integrity with raid
(cherry picked from commit 211eaa284c4df992916e0a523d0ff932aa790a98)
---
WHATS_NEW | 1 +
1 file changed, 1 insertion(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index 89583f7..c0267b7 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.10 -
=================================
+ Add integrity with raid capability.
Fix support for lvconvert --repair used by foreign apps (i.e. Docker).
Version 2.03.09 - 26th March 2020
--
1.8.3.1

View File

@ -0,0 +1,15 @@
WHATS_NEW | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index db914c0..89583f7 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,7 @@
+Version 2.03.10 -
+=================================
+ Fix support for lvconvert --repair used by foreign apps (i.e. Docker).
+
Version 2.03.09 - 26th March 2020
=================================
Fix formating of vdopool (vdo_slab_size_mb was smaller by 2 bits).

View File

@ -0,0 +1,179 @@
WHATS_NEW_DM | 4 ++++
man/blkdeactivate.8_main | 11 +++++++++++
scripts/blkdeactivate.sh.in | 48 ++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 62 insertions(+), 1 deletion(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 12bdcea..3ec9c3c 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,7 @@
+Version 1.02.173 -
+==================================
+ Add support for VDO in blkdeactivate script.
+
Version 1.02.171 - 26th March 2020
==================================
Fix dm_list interators with gcc 10 optimization (-ftree-pta).
diff --git a/man/blkdeactivate.8_main b/man/blkdeactivate.8_main
index f3c19a8..06af52e 100644
--- a/man/blkdeactivate.8_main
+++ b/man/blkdeactivate.8_main
@@ -9,6 +9,7 @@ blkdeactivate \(em utility to deactivate block devices
.RB [ -l \ \fIlvm_options\fP ]
.RB [ -m \ \fImpath_options\fP ]
.RB [ -r \ \fImdraid_options\fP ]
+.RB [ -o \ \fIvdo_options\fP ]
.RB [ -u ]
.RB [ -v ]
.RI [ device ]
@@ -70,6 +71,15 @@ Comma-separated list of MD RAID specific options:
Wait MD device's resync, recovery or reshape action to complete
before deactivation.
.RE
+
+.TP
+.BR -o ", " --vdooptions \ \fIvdo_options\fP
+Comma-separated list of VDO specific options:
+.RS
+.IP \fIconfigfile=file\fP
+Use specified VDO configuration file.
+.RE
+
.TP
.BR -u ", " --umount
Unmount a mounted device before trying to deactivate it.
@@ -120,4 +130,5 @@ of a device-mapper device fails, retry it and force removal.
.BR lvm (8),
.BR mdadm (8),
.BR multipathd (8),
+.BR vdo (8),
.BR umount (8)
diff --git a/scripts/blkdeactivate.sh.in b/scripts/blkdeactivate.sh.in
index a4b8a8f..57b3e58 100644
--- a/scripts/blkdeactivate.sh.in
+++ b/scripts/blkdeactivate.sh.in
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (C) 2012-2017 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2012-2020 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
#
@@ -38,6 +38,7 @@ MDADM="/sbin/mdadm"
MOUNTPOINT="/bin/mountpoint"
MPATHD="/sbin/multipathd"
UMOUNT="/bin/umount"
+VDO="/bin/vdo"
sbindir="@SBINDIR@"
DMSETUP="$sbindir/dmsetup"
@@ -54,6 +55,7 @@ DMSETUP_OPTS=""
LVM_OPTS=""
MDADM_OPTS=""
MPATHD_OPTS=""
+VDO_OPTS=""
LSBLK="/bin/lsblk -r --noheadings -o TYPE,KNAME,NAME,MOUNTPOINT"
LSBLK_VARS="local devtype local kname local name local mnt"
@@ -124,6 +126,7 @@ usage() {
echo " -l | --lvmoptions LVM_OPTIONS Comma separated LVM specific options"
echo " -m | --mpathoptions MPATH_OPTIONS Comma separated DM-multipath specific options"
echo " -r | --mdraidoptions MDRAID_OPTIONS Comma separated MD RAID specific options"
+ echo " -o | --vdooptions VDO_OPTIONS Comma separated VDO specific options"
echo " -u | --umount Unmount the device if mounted"
echo " -v | --verbose Verbose mode (also implies -e)"
echo
@@ -138,6 +141,8 @@ usage() {
echo " wait wait for resync, recovery or reshape to complete first"
echo " MPATH_OPTIONS:"
echo " disablequeueing disable queueing on all DM-multipath devices first"
+ echo " VDO_OPTIONS:"
+ echo " configfile=file use specified VDO configuration file"
exit
}
@@ -319,6 +324,23 @@ deactivate_md () {
fi
}
+deactivate_vdo() {
+ local xname
+ xname=$(printf "%s" "$name")
+ test -b "$DEV_DIR/mapper/$xname" || return 0
+ test -z "${SKIP_DEVICE_LIST["$kname"]}" || return 1
+
+ deactivate_holders "$DEV_DIR/mapper/$xname" || return 1
+
+ echo -n " [VDO]: deactivating VDO volume $xname... "
+ if eval "$VDO" stop $VDO_OPTS --name="$xname" "$OUT" "$ERR"; then
+ echo "done"
+ else
+ echo "skipping"
+ add_device_to_skip_list
+ fi
+}
+
deactivate () {
######################################################################
# DEACTIVATION HOOKS FOR NEW DEVICE TYPES GO HERE! #
@@ -335,6 +357,8 @@ deactivate () {
######################################################################
if test "$devtype" = "lvm"; then
deactivate_lvm
+ elif test "$devtype" = "vdo"; then
+ deactivate_vdo
elif test "${kname:0:3}" = "dm-"; then
deactivate_dm
elif test "${kname:0:2}" = "md"; then
@@ -479,6 +503,20 @@ get_mpathopts() {
IFS=$ORIG_IFS
}
+get_vdoopts() {
+ ORIG_IFS=$IFS; IFS=','
+
+ for opt in $1; do
+ case "$opt" in
+ "") ;;
+ configfile=*) tmp=${opt#*=}; VDO_OPTS+="--confFile=${tmp%%,*} " ;;
+ *) echo "$opt: unknown VDO option"
+ esac
+ done
+
+ IFS=$ORIG_IFS
+}
+
set_env() {
if test "$ERRORS" -eq "1"; then
unset ERR
@@ -493,6 +531,7 @@ set_env() {
LVM_OPTS+="-vvvv"
MDADM_OPTS+="-vv"
MPATHD_OPTS+="-v 3"
+ VDO_OPTS+="--verbose "
else
OUT="1>$DEV_DIR/null"
fi
@@ -509,6 +548,12 @@ set_env() {
MDADM_AVAILABLE=0
fi
+ if test -f $VDO; then
+ VDO_AVAILABLE=1
+ else
+ VDO_AVAILABLE=0
+ fi
+
MPATHD_RUNNING=0
test "$MPATHD_DO_DISABLEQUEUEING" -eq 1 && {
if test -f "$MPATHD"; then
@@ -528,6 +573,7 @@ while test $# -ne 0; do
"-l"|"--lvmoptions") get_lvmopts "$2" ; shift ;;
"-m"|"--mpathoptions") get_mpathopts "$2" ; shift ;;
"-r"|"--mdraidoptions") get_mdraidopts "$2"; shift ;;
+ "-o"|"--vdooptions") get_vdoopts "$2"; shift ;;
"-u"|"--umount") DO_UMOUNT=1 ;;
"-v"|"--verbose") VERBOSE=1 ; ERRORS=1 ;;
"-vv") VERBOSE=1 ; ERRORS=1 ; set -x ;;

View File

@ -0,0 +1,180 @@
From 7def94164ae6c18d84e40f00db2e2b74a7662b35 Mon Sep 17 00:00:00 2001
From: Marian Csontos <mcsontos@redhat.com>
Date: Tue, 5 May 2020 10:20:18 +0200
Subject: [PATCH] build: make generate
(cherry picked from commit bcc149048440dce5fc7962f88ed523469dd39a32)
---
man/lvconvert.8_pregen | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++
man/lvcreate.8_pregen | 53 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 116 insertions(+)
diff --git a/man/lvconvert.8_pregen b/man/lvconvert.8_pregen
index b676e72..7440984 100644
--- a/man/lvconvert.8_pregen
+++ b/man/lvconvert.8_pregen
@@ -163,6 +163,18 @@ lvconvert - Change logical volume layout
.ad b
.br
.ad l
+ \fB--raidintegrity\fP \fBy\fP|\fBn\fP
+.ad b
+.br
+.ad l
+ \fB--raidintegrityblocksize\fP \fINumber\fP
+.ad b
+.br
+.ad l
+ \fB--raidintegritymode\fP \fIString\fP
+.ad b
+.br
+.ad l
\fB-r\fP|\fB--readahead\fP \fBauto\fP|\fBnone\fP|\fINumber\fP
.ad b
.br
@@ -982,6 +994,28 @@ Poll LV to continue conversion.
.br
-
+Add or remove data integrity checksums to raid images.
+.br
+.P
+\fBlvconvert\fP \fB--raidintegrity\fP \fBy\fP|\fBn\fP \fILV\fP\fI_raid\fP
+.br
+.RS 4
+.ad l
+[ \fB--raidintegritymode\fP \fIString\fP ]
+.ad b
+.br
+.ad l
+[ \fB--raidintegrityblocksize\fP \fINumber\fP ]
+.ad b
+.br
+[ COMMON_OPTIONS ]
+.RE
+.br
+.RS 4
+[ \fIPV\fP ... ]
+.RE
+-
+
Common options for command:
.
.RS 4
@@ -1405,6 +1439,35 @@ Repeat once to also suppress any prompts with answer 'no'.
.ad b
.HP
.ad l
+\fB--raidintegrity\fP \fBy\fP|\fBn\fP
+.br
+Enable or disable data integrity checksums for raid images.
+.ad b
+.HP
+.ad l
+\fB--raidintegrityblocksize\fP \fINumber\fP
+.br
+The block size to use for dm-integrity on raid images.
+The integrity block size should usually match the device
+logical block size, or the file system block size.
+It may be less than the file system block size, but not
+less than the device logical block size.
+Possible values: 512, 1024, 2048, 4096.
+.ad b
+.HP
+.ad l
+\fB--raidintegritymode\fP \fIString\fP
+.br
+Use a journal (default) or bitmap for keeping integrity checksums consistent
+in case of a crash. The bitmap areas are recalculated after a crash, so corruption
+in those areas would not be detected. A journal does not have this problem.
+The journal mode doubles writes to storage, but can improve performance for
+scattered writes packed into a single journal write.
+bitmap mode can in theory achieve full write throughput of the device,
+but would not benefit from the potential scattered write optimization.
+.ad b
+.HP
+.ad l
\fB-r\fP|\fB--readahead\fP \fBauto\fP|\fBnone\fP|\fINumber\fP
.br
Sets read ahead sector count of an LV.
diff --git a/man/lvcreate.8_pregen b/man/lvcreate.8_pregen
index a80f9f5..be8e783 100644
--- a/man/lvcreate.8_pregen
+++ b/man/lvcreate.8_pregen
@@ -187,6 +187,18 @@ lvcreate - Create a logical volume
.ad b
.br
.ad l
+ \fB--raidintegrity\fP \fBy\fP|\fBn\fP
+.ad b
+.br
+.ad l
+ \fB--raidintegrityblocksize\fP \fINumber\fP
+.ad b
+.br
+.ad l
+ \fB--raidintegritymode\fP \fIString\fP
+.ad b
+.br
+.ad l
\fB-r\fP|\fB--readahead\fP \fBauto\fP|\fBnone\fP|\fINumber\fP
.ad b
.br
@@ -425,6 +437,18 @@ Create a raid LV (a specific raid level must be used, e.g. raid1).
[ \fB--[raid]maxrecoveryrate\fP \fISize\fP[k|UNIT] ]
.ad b
.br
+.ad l
+[ \fB--raidintegrity\fP \fBy\fP|\fBn\fP ]
+.ad b
+.br
+.ad l
+[ \fB--raidintegritymode\fP \fIString\fP ]
+.ad b
+.br
+.ad l
+[ \fB--raidintegrityblocksize\fP \fINumber\fP ]
+.ad b
+.br
[ COMMON_OPTIONS ]
.RE
.br
@@ -1420,6 +1444,35 @@ Repeat once to also suppress any prompts with answer 'no'.
.ad b
.HP
.ad l
+\fB--raidintegrity\fP \fBy\fP|\fBn\fP
+.br
+Enable or disable data integrity checksums for raid images.
+.ad b
+.HP
+.ad l
+\fB--raidintegrityblocksize\fP \fINumber\fP
+.br
+The block size to use for dm-integrity on raid images.
+The integrity block size should usually match the device
+logical block size, or the file system block size.
+It may be less than the file system block size, but not
+less than the device logical block size.
+Possible values: 512, 1024, 2048, 4096.
+.ad b
+.HP
+.ad l
+\fB--raidintegritymode\fP \fIString\fP
+.br
+Use a journal (default) or bitmap for keeping integrity checksums consistent
+in case of a crash. The bitmap areas are recalculated after a crash, so corruption
+in those areas would not be detected. A journal does not have this problem.
+The journal mode doubles writes to storage, but can improve performance for
+scattered writes packed into a single journal write.
+bitmap mode can in theory achieve full write throughput of the device,
+but would not benefit from the potential scattered write optimization.
+.ad b
+.HP
+.ad l
\fB-r\fP|\fB--readahead\fP \fBauto\fP|\fBnone\fP|\fINumber\fP
.br
Sets read ahead sector count of an LV.
--
1.8.3.1

View File

@ -0,0 +1,17 @@
tools/lvconvert.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index f6d9a29..bb40930 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2388,7 +2388,8 @@ static int _lvconvert_thin_pool_repair(struct cmd_context *cmd,
goto deactivate_mlv;
}
- if (thin_dump[0]) {
+ /* Check matching transactionId when thin-pool is used by lvm2 (transactionId != 0) */
+ if (first_seg(pool_lv)->transaction_id && thin_dump[0]) {
argv[0] = thin_dump;
argv[1] = pms_path;
argv[2] = NULL;

View File

@ -0,0 +1,641 @@
From 945de675c47d891d1f181f15971d26ff959ac631 Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Tue, 14 Jan 2020 14:12:20 -0600
Subject: [PATCH 1/3] move pv_list code into lib
(cherry picked from commit b6b4ad8e28eff7476cb04c4cb93312b06605b82f)
---
lib/Makefile.in | 1 +
lib/metadata/metadata-exported.h | 4 +
lib/metadata/pv_list.c | 291 +++++++++++++++++++++++++++++++++++++++
tools/toollib.c | 270 ------------------------------------
tools/toollib.h | 9 --
5 files changed, 296 insertions(+), 279 deletions(-)
create mode 100644 lib/metadata/pv_list.c
diff --git a/lib/Makefile.in b/lib/Makefile.in
index c037b41..2a064f3 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -74,6 +74,7 @@ SOURCES =\
metadata/mirror.c \
metadata/pool_manip.c \
metadata/pv.c \
+ metadata/pv_list.c \
metadata/pv_manip.c \
metadata/pv_map.c \
metadata/raid_manip.c \
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index c61c85c..35c1231 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -1385,4 +1385,8 @@ int vg_is_foreign(struct volume_group *vg);
void vg_write_commit_bad_mdas(struct cmd_context *cmd, struct volume_group *vg);
+struct dm_list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int argc,
+ char **argv, int allocatable_only);
+struct dm_list *clone_pv_list(struct dm_pool *mem, struct dm_list *pvsl);
+
#endif
diff --git a/lib/metadata/pv_list.c b/lib/metadata/pv_list.c
new file mode 100644
index 0000000..143b573
--- /dev/null
+++ b/lib/metadata/pv_list.c
@@ -0,0 +1,291 @@
+/*
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
+ * Copyright (C) 2004-2017 Red Hat, Inc. All rights reserved.
+ *
+ * This file is part of LVM2.
+ *
+ * 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 Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser 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
+ */
+
+#include "lib/misc/lib.h"
+#include "lib/misc/lvm-string.h"
+#include "lib/datastruct/str_list.h"
+#include "lib/device/device.h"
+#include "lib/metadata/metadata.h"
+
+/*
+ * Process physical extent range specifiers
+ */
+static int _add_pe_range(struct dm_pool *mem, const char *pvname,
+ struct dm_list *pe_ranges, uint32_t start, uint32_t count)
+{
+ struct pe_range *per;
+
+ log_debug("Adding PE range: start PE " FMTu32 " length " FMTu32 " on %s.",
+ start, count, pvname);
+
+ /* Ensure no overlap with existing areas */
+ dm_list_iterate_items(per, pe_ranges) {
+ if (((start < per->start) && (start + count - 1 >= per->start)) ||
+ ((start >= per->start) &&
+ (per->start + per->count - 1) >= start)) {
+ log_error("Overlapping PE ranges specified (" FMTu32
+ "-" FMTu32 ", " FMTu32 "-" FMTu32 ") on %s.",
+ start, start + count - 1, per->start,
+ per->start + per->count - 1, pvname);
+ return 0;
+ }
+ }
+
+ if (!(per = dm_pool_alloc(mem, sizeof(*per)))) {
+ log_error("Allocation of list failed.");
+ return 0;
+ }
+
+ per->start = start;
+ per->count = count;
+ dm_list_add(pe_ranges, &per->list);
+
+ return 1;
+}
+
+static int _xstrtouint32(const char *s, char **p, int base, uint32_t *result)
+{
+ unsigned long ul;
+
+ errno = 0;
+ ul = strtoul(s, p, base);
+
+ if (errno || *p == s || ul > UINT32_MAX)
+ return 0;
+
+ *result = ul;
+
+ return 1;
+}
+
+static int _parse_pes(struct dm_pool *mem, char *c, struct dm_list *pe_ranges,
+ const char *pvname, uint32_t size)
+{
+ char *endptr;
+ uint32_t start, end, len;
+
+ /* Default to whole PV */
+ if (!c) {
+ if (!_add_pe_range(mem, pvname, pe_ranges, UINT32_C(0), size))
+ return_0;
+ return 1;
+ }
+
+ while (*c) {
+ if (*c != ':')
+ goto error;
+
+ c++;
+
+ /* Disallow :: and :\0 */
+ if (*c == ':' || !*c)
+ goto error;
+
+ /* Default to whole range */
+ start = UINT32_C(0);
+ end = size - 1;
+
+ /* Start extent given? */
+ if (isdigit(*c)) {
+ if (!_xstrtouint32(c, &endptr, 10, &start))
+ goto error;
+ c = endptr;
+ /* Just one number given? */
+ if (!*c || *c == ':')
+ end = start;
+ }
+ /* Range? */
+ if (*c == '-') {
+ c++;
+ if (isdigit(*c)) {
+ if (!_xstrtouint32(c, &endptr, 10, &end))
+ goto error;
+ c = endptr;
+ }
+ } else if (*c == '+') { /* Length? */
+ c++;
+ if (isdigit(*c)) {
+ if (!_xstrtouint32(c, &endptr, 10, &len))
+ goto error;
+ c = endptr;
+ end = start + (len ? (len - 1) : 0);
+ }
+ }
+
+ if (*c && *c != ':')
+ goto error;
+
+ if ((start > end) || (end > size - 1)) {
+ log_error("PE range error: start extent %" PRIu32 " to "
+ "end extent %" PRIu32 ".", start, end);
+ return 0;
+ }
+
+ if (!_add_pe_range(mem, pvname, pe_ranges, start, end - start + 1))
+ return_0;
+
+ }
+
+ return 1;
+
+ error:
+ log_error("Physical extent parsing error at %s.", c);
+ return 0;
+}
+
+static int _create_pv_entry(struct dm_pool *mem, struct pv_list *pvl,
+ char *colon, int allocatable_only, struct dm_list *r)
+{
+ const char *pvname;
+ struct pv_list *new_pvl = NULL, *pvl2;
+ struct dm_list *pe_ranges;
+
+ pvname = pv_dev_name(pvl->pv);
+ if (allocatable_only && !(pvl->pv->status & ALLOCATABLE_PV)) {
+ log_warn("WARNING: Physical volume %s not allocatable.", pvname);
+ return 1;
+ }
+
+ if (allocatable_only && is_missing_pv(pvl->pv)) {
+ log_warn("WARNING: Physical volume %s is missing.", pvname);
+ return 1;
+ }
+
+ if (allocatable_only &&
+ (pvl->pv->pe_count == pvl->pv->pe_alloc_count)) {
+ log_warn("WARNING: No free extents on physical volume \"%s\".", pvname);
+ return 1;
+ }
+
+ dm_list_iterate_items(pvl2, r)
+ if (pvl->pv->dev == pvl2->pv->dev) {
+ new_pvl = pvl2;
+ break;
+ }
+
+ if (!new_pvl) {
+ if (!(new_pvl = dm_pool_alloc(mem, sizeof(*new_pvl)))) {
+ log_error("Unable to allocate physical volume list.");
+ return 0;
+ }
+
+ memcpy(new_pvl, pvl, sizeof(*new_pvl));
+
+ if (!(pe_ranges = dm_pool_alloc(mem, sizeof(*pe_ranges)))) {
+ log_error("Allocation of pe_ranges list failed.");
+ return 0;
+ }
+ dm_list_init(pe_ranges);
+ new_pvl->pe_ranges = pe_ranges;
+ dm_list_add(r, &new_pvl->list);
+ }
+
+ /* Determine selected physical extents */
+ if (!_parse_pes(mem, colon, new_pvl->pe_ranges, pv_dev_name(pvl->pv),
+ pvl->pv->pe_count))
+ return_0;
+
+ return 1;
+}
+
+struct dm_list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int argc,
+ char **argv, int allocatable_only)
+{
+ struct dm_list *r;
+ struct pv_list *pvl;
+ struct dm_list tagsl, arg_pvnames;
+ char *pvname = NULL;
+ char *colon, *at_sign, *tagname;
+ int i;
+
+ /* Build up list of PVs */
+ if (!(r = dm_pool_alloc(mem, sizeof(*r)))) {
+ log_error("Allocation of list failed.");
+ return NULL;
+ }
+ dm_list_init(r);
+
+ dm_list_init(&tagsl);
+ dm_list_init(&arg_pvnames);
+
+ for (i = 0; i < argc; i++) {
+ dm_unescape_colons_and_at_signs(argv[i], &colon, &at_sign);
+
+ if (at_sign && (at_sign == argv[i])) {
+ tagname = at_sign + 1;
+ if (!validate_tag(tagname)) {
+ log_error("Skipping invalid tag %s.", tagname);
+ continue;
+ }
+ dm_list_iterate_items(pvl, &vg->pvs) {
+ if (str_list_match_item(&pvl->pv->tags,
+ tagname)) {
+ if (!_create_pv_entry(mem, pvl, NULL,
+ allocatable_only,
+ r))
+ return_NULL;
+ }
+ }
+ continue;
+ }
+
+ pvname = argv[i];
+
+ if (colon && !(pvname = dm_pool_strndup(mem, pvname,
+ (unsigned) (colon - pvname)))) {
+ log_error("Failed to clone PV name.");
+ return NULL;
+ }
+
+ if (!(pvl = find_pv_in_vg(vg, pvname))) {
+ log_error("Physical Volume \"%s\" not found in "
+ "Volume Group \"%s\".", pvname, vg->name);
+ return NULL;
+ }
+ if (!_create_pv_entry(mem, pvl, colon, allocatable_only, r))
+ return_NULL;
+ }
+
+ if (dm_list_empty(r))
+ log_error("No specified PVs have space available.");
+
+ return dm_list_empty(r) ? NULL : r;
+}
+
+struct dm_list *clone_pv_list(struct dm_pool *mem, struct dm_list *pvsl)
+{
+ struct dm_list *r;
+ struct pv_list *pvl, *new_pvl;
+
+ /* Build up list of PVs */
+ if (!(r = dm_pool_alloc(mem, sizeof(*r)))) {
+ log_error("Allocation of list failed.");
+ return NULL;
+ }
+ dm_list_init(r);
+
+ dm_list_iterate_items(pvl, pvsl) {
+ if (!(new_pvl = dm_pool_zalloc(mem, sizeof(*new_pvl)))) {
+ log_error("Unable to allocate physical volume list.");
+ return NULL;
+ }
+
+ memcpy(new_pvl, pvl, sizeof(*new_pvl));
+ dm_list_add(r, &new_pvl->list);
+ }
+
+ return r;
+}
+
diff --git a/tools/toollib.c b/tools/toollib.c
index a5304bf..6386a69 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -457,276 +457,6 @@ const char *extract_vgname(struct cmd_context *cmd, const char *lv_name)
return vg_name;
}
-/*
- * Process physical extent range specifiers
- */
-static int _add_pe_range(struct dm_pool *mem, const char *pvname,
- struct dm_list *pe_ranges, uint32_t start, uint32_t count)
-{
- struct pe_range *per;
-
- log_debug("Adding PE range: start PE " FMTu32 " length " FMTu32 " on %s.",
- start, count, pvname);
-
- /* Ensure no overlap with existing areas */
- dm_list_iterate_items(per, pe_ranges) {
- if (((start < per->start) && (start + count - 1 >= per->start)) ||
- ((start >= per->start) &&
- (per->start + per->count - 1) >= start)) {
- log_error("Overlapping PE ranges specified (" FMTu32
- "-" FMTu32 ", " FMTu32 "-" FMTu32 ") on %s.",
- start, start + count - 1, per->start,
- per->start + per->count - 1, pvname);
- return 0;
- }
- }
-
- if (!(per = dm_pool_alloc(mem, sizeof(*per)))) {
- log_error("Allocation of list failed.");
- return 0;
- }
-
- per->start = start;
- per->count = count;
- dm_list_add(pe_ranges, &per->list);
-
- return 1;
-}
-
-static int _xstrtouint32(const char *s, char **p, int base, uint32_t *result)
-{
- unsigned long ul;
-
- errno = 0;
- ul = strtoul(s, p, base);
-
- if (errno || *p == s || ul > UINT32_MAX)
- return 0;
-
- *result = ul;
-
- return 1;
-}
-
-static int _parse_pes(struct dm_pool *mem, char *c, struct dm_list *pe_ranges,
- const char *pvname, uint32_t size)
-{
- char *endptr;
- uint32_t start, end, len;
-
- /* Default to whole PV */
- if (!c) {
- if (!_add_pe_range(mem, pvname, pe_ranges, UINT32_C(0), size))
- return_0;
- return 1;
- }
-
- while (*c) {
- if (*c != ':')
- goto error;
-
- c++;
-
- /* Disallow :: and :\0 */
- if (*c == ':' || !*c)
- goto error;
-
- /* Default to whole range */
- start = UINT32_C(0);
- end = size - 1;
-
- /* Start extent given? */
- if (isdigit(*c)) {
- if (!_xstrtouint32(c, &endptr, 10, &start))
- goto error;
- c = endptr;
- /* Just one number given? */
- if (!*c || *c == ':')
- end = start;
- }
- /* Range? */
- if (*c == '-') {
- c++;
- if (isdigit(*c)) {
- if (!_xstrtouint32(c, &endptr, 10, &end))
- goto error;
- c = endptr;
- }
- } else if (*c == '+') { /* Length? */
- c++;
- if (isdigit(*c)) {
- if (!_xstrtouint32(c, &endptr, 10, &len))
- goto error;
- c = endptr;
- end = start + (len ? (len - 1) : 0);
- }
- }
-
- if (*c && *c != ':')
- goto error;
-
- if ((start > end) || (end > size - 1)) {
- log_error("PE range error: start extent %" PRIu32 " to "
- "end extent %" PRIu32 ".", start, end);
- return 0;
- }
-
- if (!_add_pe_range(mem, pvname, pe_ranges, start, end - start + 1))
- return_0;
-
- }
-
- return 1;
-
- error:
- log_error("Physical extent parsing error at %s.", c);
- return 0;
-}
-
-static int _create_pv_entry(struct dm_pool *mem, struct pv_list *pvl,
- char *colon, int allocatable_only, struct dm_list *r)
-{
- const char *pvname;
- struct pv_list *new_pvl = NULL, *pvl2;
- struct dm_list *pe_ranges;
-
- pvname = pv_dev_name(pvl->pv);
- if (allocatable_only && !(pvl->pv->status & ALLOCATABLE_PV)) {
- log_warn("WARNING: Physical volume %s not allocatable.", pvname);
- return 1;
- }
-
- if (allocatable_only && is_missing_pv(pvl->pv)) {
- log_warn("WARNING: Physical volume %s is missing.", pvname);
- return 1;
- }
-
- if (allocatable_only &&
- (pvl->pv->pe_count == pvl->pv->pe_alloc_count)) {
- log_warn("WARNING: No free extents on physical volume \"%s\".", pvname);
- return 1;
- }
-
- dm_list_iterate_items(pvl2, r)
- if (pvl->pv->dev == pvl2->pv->dev) {
- new_pvl = pvl2;
- break;
- }
-
- if (!new_pvl) {
- if (!(new_pvl = dm_pool_alloc(mem, sizeof(*new_pvl)))) {
- log_error("Unable to allocate physical volume list.");
- return 0;
- }
-
- memcpy(new_pvl, pvl, sizeof(*new_pvl));
-
- if (!(pe_ranges = dm_pool_alloc(mem, sizeof(*pe_ranges)))) {
- log_error("Allocation of pe_ranges list failed.");
- return 0;
- }
- dm_list_init(pe_ranges);
- new_pvl->pe_ranges = pe_ranges;
- dm_list_add(r, &new_pvl->list);
- }
-
- /* Determine selected physical extents */
- if (!_parse_pes(mem, colon, new_pvl->pe_ranges, pv_dev_name(pvl->pv),
- pvl->pv->pe_count))
- return_0;
-
- return 1;
-}
-
-struct dm_list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int argc,
- char **argv, int allocatable_only)
-{
- struct dm_list *r;
- struct pv_list *pvl;
- struct dm_list tagsl, arg_pvnames;
- char *pvname = NULL;
- char *colon, *at_sign, *tagname;
- int i;
-
- /* Build up list of PVs */
- if (!(r = dm_pool_alloc(mem, sizeof(*r)))) {
- log_error("Allocation of list failed.");
- return NULL;
- }
- dm_list_init(r);
-
- dm_list_init(&tagsl);
- dm_list_init(&arg_pvnames);
-
- for (i = 0; i < argc; i++) {
- dm_unescape_colons_and_at_signs(argv[i], &colon, &at_sign);
-
- if (at_sign && (at_sign == argv[i])) {
- tagname = at_sign + 1;
- if (!validate_tag(tagname)) {
- log_error("Skipping invalid tag %s.", tagname);
- continue;
- }
- dm_list_iterate_items(pvl, &vg->pvs) {
- if (str_list_match_item(&pvl->pv->tags,
- tagname)) {
- if (!_create_pv_entry(mem, pvl, NULL,
- allocatable_only,
- r))
- return_NULL;
- }
- }
- continue;
- }
-
- pvname = argv[i];
-
- if (colon && !(pvname = dm_pool_strndup(mem, pvname,
- (unsigned) (colon - pvname)))) {
- log_error("Failed to clone PV name.");
- return NULL;
- }
-
- if (!(pvl = find_pv_in_vg(vg, pvname))) {
- log_error("Physical Volume \"%s\" not found in "
- "Volume Group \"%s\".", pvname, vg->name);
- return NULL;
- }
- if (!_create_pv_entry(mem, pvl, colon, allocatable_only, r))
- return_NULL;
- }
-
- if (dm_list_empty(r))
- log_error("No specified PVs have space available.");
-
- return dm_list_empty(r) ? NULL : r;
-}
-
-struct dm_list *clone_pv_list(struct dm_pool *mem, struct dm_list *pvsl)
-{
- struct dm_list *r;
- struct pv_list *pvl, *new_pvl;
-
- /* Build up list of PVs */
- if (!(r = dm_pool_alloc(mem, sizeof(*r)))) {
- log_error("Allocation of list failed.");
- return NULL;
- }
- dm_list_init(r);
-
- dm_list_iterate_items(pvl, pvsl) {
- if (!(new_pvl = dm_pool_zalloc(mem, sizeof(*new_pvl)))) {
- log_error("Unable to allocate physical volume list.");
- return NULL;
- }
-
- memcpy(new_pvl, pvl, sizeof(*new_pvl));
- dm_list_add(r, &new_pvl->list);
- }
-
- return r;
-}
-
const char _pe_size_may_not_be_negative_msg[] = "Physical extent size may not be negative.";
int vgcreate_params_set_defaults(struct cmd_context *cmd,
diff --git a/tools/toollib.h b/tools/toollib.h
index 9102f55..53a5e5b 100644
--- a/tools/toollib.h
+++ b/tools/toollib.h
@@ -182,15 +182,6 @@ void opt_array_to_str(struct cmd_context *cmd, int *opts, int count,
int pvcreate_params_from_args(struct cmd_context *cmd, struct pvcreate_params *pp);
int pvcreate_each_device(struct cmd_context *cmd, struct processing_handle *handle, struct pvcreate_params *pp);
-/*
- * Builds a list of pv's from the names in argv. Used in
- * lvcreate/extend.
- */
-struct dm_list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int argc,
- char **argv, int allocatable_only);
-
-struct dm_list *clone_pv_list(struct dm_pool *mem, struct dm_list *pvs);
-
int vgcreate_params_set_defaults(struct cmd_context *cmd,
struct vgcreate_params *vp_def,
struct volume_group *vg);
--
1.8.3.1

View File

@ -0,0 +1,82 @@
test/shell/thin-foreign-repair.sh | 72 +++++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
create mode 100644 test/shell/thin-foreign-repair.sh
diff --git a/test/shell/thin-foreign-repair.sh b/test/shell/thin-foreign-repair.sh
new file mode 100644
index 0000000..147a9a0
--- /dev/null
+++ b/test/shell/thin-foreign-repair.sh
@@ -0,0 +1,72 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2020 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
+
+# test foreing user of thin-pool
+
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+cleanup_mounted_and_teardown()
+{
+ dmsetup remove $THIN || true
+ vgremove -ff $vg
+ aux teardown
+}
+
+#
+# Main
+#
+aux have_thin 1 0 0 || skip
+which mkfs.ext4 || skip
+
+# Use our mkfs config file to get approximately same results
+# TODO: maybe use it for all test via some 'prepare' function
+export MKE2FS_CONFIG="$TESTOLDPWD/lib/mke2fs.conf"
+
+aux prepare_vg 2 64
+
+# Create named pool only
+lvcreate -L2 -T $vg/pool
+
+POOL="$vg-pool"
+THIN="${PREFIX}_thin"
+
+# Foreing user is using own ioctl command to create thin devices
+dmsetup message $POOL 0 "create_thin 0"
+dmsetup message $POOL 0 "set_transaction_id 0 2"
+
+# Once the transaction id has changed, lvm2 shall not be able to create thinLV
+fail lvcreate -V10 $vg/pool
+
+trap 'cleanup_mounted_and_teardown' EXIT
+
+# 20M thin device
+dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/mapper/$POOL 0"
+
+mkfs.ext4 "$DM_DEV_DIR/mapper/$THIN"
+
+dmsetup remove "$THIN"
+
+lvchange -an $vg/pool
+
+# Repair thin-pool used by 'foreing' apps (setting their own tid)
+lvconvert --repair $vg/pool 2>&1 | tee out
+
+not grep "Transaction id" out
+
+lvchange -ay $vg/pool
+
+dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/mapper/$POOL 0"
+
+fsck -n "$DM_DEV_DIR/mapper/$THIN"

View File

@ -3,17 +3,16 @@
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 717c4cf..b7fddf4 100644
index 8c4a9a8..00618e0 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.03.07(2) (2019-11-30)
+2.03.07(2)-RHEL8 (2019-11-30)
-2.03.09(2) (2020-03-26)
+2.03.09(2)-RHEL8 (2020-04-21)
diff --git a/VERSION_DM b/VERSION_DM
index a230ed0..fc0ec81 100644
index 0ae62fd..b9ec43e 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.167 (2019-11-30)
+1.02.167-RHEL8 (2019-11-30)
-1.02.171 (2020-03-26)
+1.02.171-RHEL8 (2020-04-21)

View File

@ -1,3 +1,9 @@
From 6a078fe01b47fa165226a15263c8bd6350b1c307 Mon Sep 17 00:00:00 2001
From: Marian Csontos <mcsontos@redhat.com>
Date: Thu, 3 Jan 2019 13:49:08 +0100
Subject: [PATCH 2/8] lvm2: set default preferred_names
---
conf/example.conf.in | 3 ++-
lib/config/config_settings.h | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
@ -29,3 +35,6 @@ index 2bb72ba..dce9705 100644
"Select which path name to display for a block device.\n"
"If multiple path names exist for a block device, and LVM needs to\n"
"display a name for the device, the path names are matched against\n"
--
1.8.3.1

View File

@ -1,12 +1,18 @@
From 74f05f17ea3d1a3639a65ba337f2b7df7f4981bf Mon Sep 17 00:00:00 2001
From: Marian Csontos <mcsontos@redhat.com>
Date: Sun, 18 Aug 2019 17:31:30 +0200
Subject: [PATCH 3/8] lvm2: test: skip-problematic-tests
---
test/dbus/lvmdbustest.py | 1 +
test/shell/lvcreate-usage.sh | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index 9bc1683..1b5608c 100755
index 8753e65..b2986bf 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -1885,6 +1885,7 @@ class TestDbusService(unittest.TestCase):
@@ -1821,6 +1821,7 @@ class TestDbusService(unittest.TestCase):
# path to it. Additionally, we will take the symlink and do a lookup
# (Manager.LookUpByLvmId) using it and the original device path to
# ensure that we can find the PV.
@ -15,24 +21,28 @@ index 9bc1683..1b5608c 100755
pv = self.objs[PV_INT][0]
diff --git a/test/shell/lvcreate-usage.sh b/test/shell/lvcreate-usage.sh
index b1cd515..8358218 100644
index 6d46939..9e00f1c 100644
--- a/test/shell/lvcreate-usage.sh
+++ b/test/shell/lvcreate-usage.sh
@@ -182,14 +182,14 @@ DEVICE=$(dmsetup deps -o blkdevname "$dev1" | sed -e "s,.*:\ (\(.*\)),/dev/\1,")
@@ -181,15 +181,15 @@ check lv_field $vg/$lv4 lv_read_ahead "auto"
DEVICE=$(dmsetup deps -o blkdevname "$dev1" | sed -e "s,.*:\ (\(.*\)),/dev/\1,")
RASZ=$(( $(blockdev --getra "$DEVICE" ) / 2 ))
SZ="$RASZ.00k"
test "$RASZ" -ge 128 || SZ="128.00k"
-check lv_field $vg/$lv4 lv_kernel_read_ahead "$SZ" --units k
+should check lv_field $vg/$lv4 lv_kernel_read_ahead "$SZ" --units k
lvcreate -L 8 -n $lv5 -i2 --stripesize 16k --readahead auto $vg
test "$RASZ" -ge 128 || RASZ="128"
-check lv_field $vg/$lv4 lv_kernel_read_ahead "${RASZ}.00k" --units k
+should check lv_field $vg/$lv4 lv_kernel_read_ahead "${RASZ}.00k" --units k
lvcreate -vvvvv -L 8 -n $lv5 -i2 --stripesize 16k --readahead auto $vg
check lv_field $vg/$lv5 lv_read_ahead "auto"
-check lv_field $vg/$lv5 lv_kernel_read_ahead "$SZ" --units k
+should check lv_field $vg/$lv5 lv_kernel_read_ahead "$SZ" --units k
# For 16k stripe we set '128k' as the is the minimum size we get when creating DM device
-check lv_field $vg/$lv5 lv_kernel_read_ahead "128.00k" --units k
+should check lv_field $vg/$lv5 lv_kernel_read_ahead "128.00k" --units k
lvcreate -L 8 -n $lv6 -i2 --stripesize 128k --readahead auto $vg
check lv_field $vg/$lv6 lv_read_ahead "auto"
test "$RASZ" -ge 512 || SZ="512.00k"
-check lv_field $vg/$lv6 lv_kernel_read_ahead "$SZ" --units k
+should check lv_field $vg/$lv6 lv_kernel_read_ahead "$SZ" --units k
# For striped device we set double of strip size unrelated to underlaying dev RA size
-check lv_field $vg/$lv6 lv_kernel_read_ahead "512.00k" --units k
+should check lv_field $vg/$lv6 lv_kernel_read_ahead "512.00k" --units k
lvremove -ff $vg
#
--
1.8.3.1

View File

@ -1,4 +1,4 @@
%global device_mapper_version 1.02.167
%global device_mapper_version 1.02.171
%global enable_cache 1
%global enable_cluster 1
@ -11,6 +11,7 @@
%global enable_testsuite 1
%global enable_vdo 1
%global enable_writecache 1
%global enable_integrity 1
%global system_release_version 23
%global systemd_version 189-3
@ -56,14 +57,26 @@ Name: lvm2
%if 0%{?rhel}
Epoch: %{rhel}
%endif
Version: 2.03.07
Release: 1%{?dist}
Version: 2.03.09
Release: 3%{?dist}
License: GPLv2
URL: http://sourceware.org/lvm2
Source0: ftp://sourceware.org/pub/lvm2/releases/LVM2.%{version}.tgz
Patch0: lvm2-rhel8.patch
Patch1: lvm2-set-default-preferred_names.patch
Patch2: lvm2-test-skip-problematic-tests.patch
Patch3: lvm2-2_03_10-lvconvert-no-validation-for-thin-pools-not-used-by-lvm.patch
Patch4: lvm2-2_03_10-test-repair-of-thin-pool-used-by-foreign-apps.patch
Patch5: lvm2-2_03_10-WHATS_NEWS-update.patch
Patch6: lvm2-2_03_10-blkdeactivate-add-support-for-VDO-in-blkdeactivate-script.patch
Patch7: lvm2-2_03_10-Fix-scripts-lvmlocks.service.in-using-nonexistent-lock-opt-autowait.patch
Patch8: lvm2-2_03_10-move-pv_list-code-into-lib.patch
Patch9: lvm2-2_03_10-Allow-dm-integrity-to-be-used-for-raid-images.patch
Patch10: lvm2-2_03_10-WHATS_NEW-integrity-with-raid.patch
Patch11: lvm2-2_03_10-build-make-generate.patch
Patch12: 0001-Merge-master-up-to-commit-53803821de16.patch
Patch13: 0002-Merge-master-up-to-commit-be61bd6ff5c6.patch
Patch14: 0003-Merge-master-up-to-commit-6eb9eba59bf5.patch
BuildRequires: gcc
%if %{enable_testsuite}
@ -122,6 +135,18 @@ or more physical volumes and creating one or more logical volumes
%patch0 -p1 -b .backup0
%patch1 -p1 -b .backup1
%patch2 -p1 -b .backup2
%patch3 -p1 -b .backup3
%patch4 -p1 -b .backup4
%patch5 -p1 -b .backup5
%patch6 -p1 -b .backup6
%patch7 -p1 -b .backup7
%patch8 -p1 -b .backup8
%patch9 -p1 -b .backup9
%patch10 -p1 -b .backup10
%patch11 -p1 -b .backup11
%patch12 -p1 -b .backup12
%patch13 -p1 -b .backup13
%patch14 -p1 -b .backup14
%build
%global _default_pid_dir /run
@ -168,7 +193,11 @@ or more physical volumes and creating one or more logical volumes
%global configure_writecache --with-writecache=internal
%endif
%configure --with-default-dm-run-dir=%{_default_dm_run_dir} --with-default-run-dir=%{_default_run_dir} --with-default-pid-dir=%{_default_pid_dir} --with-default-locking-dir=%{_default_locking_dir} --with-usrlibdir=%{_libdir} --enable-fsadm --enable-write_install --with-user= --with-group= --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-cmdlib --enable-dmeventd --enable-blkid_wiping %{?configure_cluster} %{?configure_cmirror} %{?configure_udev} %{?configure_thin} %{?configure_cache} %{?configure_lvmpolld} %{?configure_lockd_dlm} %{?configure_lockd_sanlock} %{?configure_lvmdbusd} %{?configure_dmfilemapd} %{?configure_writecache} %{?configure_vdo} --disable-silent-rules
%if %{enable_integrity}
%global configure_integrity --with-integrity=internal
%endif
%configure --with-default-dm-run-dir=%{_default_dm_run_dir} --with-default-run-dir=%{_default_run_dir} --with-default-pid-dir=%{_default_pid_dir} --with-default-locking-dir=%{_default_locking_dir} --with-usrlibdir=%{_libdir} --enable-fsadm --enable-write_install --with-user= --with-group= --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-cmdlib --enable-dmeventd --enable-blkid_wiping %{?configure_cluster} %{?configure_cmirror} %{?configure_udev} %{?configure_thin} %{?configure_cache} %{?configure_lvmpolld} %{?configure_lockd_dlm} %{?configure_lockd_sanlock} %{?configure_lvmdbusd} %{?configure_dmfilemapd} %{?configure_writecache} %{?configure_vdo} %{?configure_integrity} --disable-silent-rules
make %{?_smp_mflags}
@ -722,6 +751,31 @@ An extensive functional testsuite for LVM2.
%endif
%changelog
* Mon Jun 29 2020 Marian Csontos <mcsontos@redhat.com> - 2.03.09-3
- Merge fixes from upstream.
* Thu May 21 2020 Marian Csontos <mcsontos@redhat.com> - 2.03.09-2
- Merge fixes from upstream.
* Fri Apr 24 2020 Marian Csontos <mcsontos@redhat.com> - 2.03.09-1
- Fix support for lvconvert --repair of pools used by third party applications.
- Fix formating of vdopool (vdo_slab_size_mb was smaller by 2 bits).
- Fix busy loop in dmeventd.
- Fix lvmlocks.service using incorrect option.
* Wed Mar 18 2020 Marian Csontos <mcsontos@redhat.com> - 2.03.08-3
- Attaching writecache require inactive LV.
* Mon Feb 24 2020 Marian Csontos <mcsontos@redhat.com> - 2.03.08-2
- Writecache bug fixes.
* Tue Feb 11 2020 Marian Csontos <mcsontos@redhat.com> - 2.03.08-1
- VDO and writecache volume improvements.
- Prohibit reshaping of stacked raid LVs to prevent corruption.
* Fri Feb 07 2020 Marian Csontos <mcsontos@redhat.com> - 2.03.07-2
- VDO: Adapt for changed vdo_format output.
* Sat Nov 30 2019 Marian Csontos <mcsontos@redhat.com> - 2.03.07-1
- Ensure minimum required region size on striped RaidLV creation.
- Fix resize of thin-pool with data and metadata of different segtype.