main - tests: skip tests that require blkid BLOCK_SIZE
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a47e20a0929bc0d3998...
Commit: a47e20a0929bc0d399851c398e7e3d06e97daf65
Parent: 39f497b9d8d35c77716014a3ba7074a2fc8955ac
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jun 30 11:56:42 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jun 30 11:56:42 2021 -0500
tests: skip tests that require blkid BLOCK_SIZE
Recent commit 84bd394cf9aaa581b4bf980f764544dda26a0305
"writecache: use block size 4096 when no fs is found"
changed the default writecache block size from 512 to 4096
when no file system is detected. The fs block size detection
requires the libblkid BLOCK_SIZE feature, so skip tests on
systems without this. Otherwise, 4096 writecache added to
512 xfs leads fs io or mount failures.
---
test/shell/lvextend-caches-on-thindata.sh | 8 ++++++++
test/shell/writecache-cache-blocksize-2.sh | 8 ++++++++
test/shell/writecache.sh | 8 ++++++++
3 files changed, 24 insertions(+)
diff --git a/test/shell/lvextend-caches-on-thindata.sh b/test/shell/lvextend-caches-on-thindata.sh
index aab571611..ef47d76d0 100644
--- a/test/shell/lvextend-caches-on-thindata.sh
+++ b/test/shell/lvextend-caches-on-thindata.sh
@@ -118,6 +118,14 @@ mkdir -p "$mount_dir"
aux prepare_devs 6 70 # want 64M of usable space from each dev
+# Tests with fs block sizes require a libblkid version that shows BLOCK_SIZE
+vgcreate $vg "$dev1"
+lvcreate -n $lv1 -L50 $vg
+mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1"
+blkid -c /dev/null "$DM_DEV_DIR/$vg/$lv1" | grep BLOCK_SIZE || skip
+lvchange -an $vg
+vgremove -ff $vg
+
# generate random data
dd if=/dev/urandom of=pattern bs=512K count=1
diff --git a/test/shell/writecache-cache-blocksize-2.sh b/test/shell/writecache-cache-blocksize-2.sh
index af4f60e1d..dfb4f19a1 100644
--- a/test/shell/writecache-cache-blocksize-2.sh
+++ b/test/shell/writecache-cache-blocksize-2.sh
@@ -159,6 +159,14 @@ _run_test() {
aux prepare_scsi_debug_dev 256 sector_size=512 physblk_exp=3
aux prepare_devs 2 64
+# Tests with fs block sizes require a libblkid version that shows BLOCK_SIZE
+vgcreate $vg "$dev1"
+lvcreate -n $lv1 -L50 $vg
+mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1"
+blkid -c /dev/null "$DM_DEV_DIR/$vg/$lv1" | grep BLOCK_SIZE || skip
+lvchange -an $vg
+vgremove -ff $vg
+
# loopa/loopb have LBS 512 PBS 512
which fallocate || skip
fallocate -l 64M loopa
diff --git a/test/shell/writecache.sh b/test/shell/writecache.sh
index e549b113c..421c5bb4f 100644
--- a/test/shell/writecache.sh
+++ b/test/shell/writecache.sh
@@ -25,6 +25,14 @@ check sysfs "$(< SCSI_DEBUG_DEV)" queue/logical_block_size "512"
check sysfs "$(< SCSI_DEBUG_DEV)" queue/physical_block_size "512"
aux prepare_devs 2 64
+# Tests with fs block sizes require a libblkid version that shows BLOCK_SIZE
+vgcreate $vg "$dev1"
+lvcreate -n $lv1 -L50 $vg
+mkfs.xfs -f "$DM_DEV_DIR/$vg/$lv1"
+blkid -c /dev/null "$DM_DEV_DIR/$vg/$lv1" | grep BLOCK_SIZE || skip
+lvchange -an $vg
+vgremove -ff $vg
+
# scsi_debug devices with 512 LBS and 4K PBS
#aux prepare_scsi_debug_dev 256 sector_size=512 physblk_exp=3
#check sysfs "$(< SCSI_DEBUG_DEV)" queue/logical_block_size "512"
2 years, 5 months
master - WHATS_NEW: update
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=39f497b9d8d35c77716...
Commit: 39f497b9d8d35c77716014a3ba7074a2fc8955ac
Parent: 580e64e93ba469b64cf11e400c4cb2f759eaf579
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 28 20:38:54 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jun 28 20:41:07 2021 +0200
WHATS_NEW: update
---
WHATS_NEW | 2 ++
1 file changed, 2 insertions(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index 2c4704310..8f6dad27a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.03.13 -
===============================
+ Support configurable allocation/vdo_pool_header_size.
+ Fix handling of lvconvert --type vdo-pool --virtualsize.
Simplified handling of archive() and backup() internal calls.
Fix load of kvdo target when it is not present in memory (2.03.12).
2 years, 5 months
master - make: generate
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=580e64e93ba469b64cf...
Commit: 580e64e93ba469b64cf11e400c4cb2f759eaf579
Parent: 2c6a2b6e86b57aeb96e93618193426ee129b00a6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 28 18:10:41 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jun 28 20:41:07 2021 +0200
make: generate
---
man/lvconvert.8_pregen | 2 +-
man/lvmdevices.8_pregen | 86 +++++++++++++++++++++++++++++++++++++------------
man/vgchange.8_pregen | 7 ----
man/vgck.8_pregen | 7 ----
4 files changed, 66 insertions(+), 36 deletions(-)
diff --git a/man/lvconvert.8_pregen b/man/lvconvert.8_pregen
index d733ab64f..4fafe5d29 100644
--- a/man/lvconvert.8_pregen
+++ b/man/lvconvert.8_pregen
@@ -670,7 +670,7 @@ Convert LV to type thin-pool.
.RE
.P
.RS 4
-LV1 types: linear striped cache raid error zero
+LV1 types: linear striped cache raid error zero writecache
.RE
.P
\(em
diff --git a/man/lvmdevices.8_pregen b/man/lvmdevices.8_pregen
index 267ce965f..e581a8d01 100644
--- a/man/lvmdevices.8_pregen
+++ b/man/lvmdevices.8_pregen
@@ -27,6 +27,8 @@ lvmdevices \(em Manage the devices file
\fB--deldev\fP \fIPV\fP
.br
\fB--delpvid\fP \fIString\fP
+.br
+ \fB--deviceidtype\fP \fIString\fP
.br
\fB--devices\fP \fIPV\fP
.br
@@ -70,18 +72,18 @@ remove it from the devices file with lvmdevices --deldev. The
vgimportdevices(8) command adds all PVs from a VG to the devices file,
and updates the VG metadata to include device IDs of the PVs.
.P
-Commands adding new devices to the devices file necessarily look outside
-the existing devices file to find the devices to add. pvcreate, vgcreate,
-and vgextend also look outside the devices file to create new PVs and add
-them to the devices file.
+Commands that add new devices to the devices file necessarily look outside
+the existing devices file to find the devices being added. pvcreate,
+vgcreate, and vgextend also look outside the devices file to create new
+PVs and add those PVs to the devices file.
.P
LVM records devices in the devices file using hardware-specific IDs, such
as the WWID, and attempts to use subsystem-specific IDs for virtual device
-types (which also aim to be as unique and stable as possible.)
-These device IDs are also written in the VG metadata. When no hardware or
+types (which also aim to be as unique and stable as possible.) These
+device IDs are also written in the VG metadata. When no hardware or
virtual ID is available, lvm falls back using the unstable device name as
-the device ID. When devnames are used, lvm performs extra scanning to
-find devices if their devname changes, e.g. after reboot.
+the device ID. When devnames are used as IDs, lvm performs extra scanning
+to find devices if their devname changes, e.g. after reboot.
.P
When proper device IDs are used, an lvm command will not look at devices
outside the devices file, but when devnames are used as a fallback, lvm
@@ -95,12 +97,13 @@ overriding the devices file. The listed devices act as a sort of devices
file in terms of limiting which devices lvm will see and use. Devices
that are not listed will appear to be missing to the lvm command.
.P
-Multiple devices files can be kept in \fI#DEFAULT_SYS_DIR#/devices\fP, which allows lvm
-to be used with different sets of devices, e.g. system devices do not need
-to be exposed to a specific application, and the application can use lvm on
-its own devices that are not exposed to the system. The option
---devicesfile <filename> is used to select the devices file to use with the
-command. Without the option set, the default system devices file is used.
+Multiple devices files can be kept \fI#DEFAULT_SYS_DIR#/devices\fP, which
+allows lvm to be used with different sets of devices. For example, system
+devices do not need to be exposed to a specific application, and the
+application can use lvm on its own devices that are not exposed to the
+system. The option --devicesfile <filename> is used to select the devices
+file to use with the command. Without the option set, the default system
+devices file is used.
.P
Setting --devicesfile "" causes lvm to not use a devices file.
.P
@@ -120,6 +123,45 @@ if it does not yet exist.
.P
It is recommended to use lvm commands to make changes to the devices file to
ensure proper updates.
+.P
+The device ID and device ID type are included in the VG metadata and can
+be reported with pvs -o deviceid,deviceidtype. (Note that the lvmdevices
+command does not update VG metadata, but subsequent lvm commands modifying
+the metadata will include the device ID.)
+.P
+Possible device ID types are:
+.br
+.IP \[bu] 2
+.B sys_wwid
+uses the wwid reported by sysfs. This is the first choice for non-virtual
+devices.
+.IP \[bu] 2
+.B sys_serial
+uses the serial number reported by sysfs. This is the second choice for
+non-virtual devices.
+.IP \[bu] 2
+.B mpath_uuid
+is used for dm multipath devices, reported by sysfs.
+.IP \[bu] 2
+.B crypt_uuid
+is used for dm crypt devices, reported by sysfs.
+.IP \[bu] 2
+.B md_uuid
+is used for md devices, reported by sysfs.
+.B lvmlv_uuid
+is used if a PV is placed on top of an lvm LV, reported by sysfs.
+.IP \[bu] 2
+.B loop_file
+is used for loop devices, the backing file name repored by sysfs.
+.IP \[bu] 2
+.B devname
+the device name is used if no other type applies.
+.P
+
+The default choice for device ID type can be overriden using lvmdevices
+--addev --deviceidtype <type>. If the specified type is available for the
+device it will be used, otherwise the device will be added using the type
+that would otherwise be chosen.
.
.SH USAGE
.
@@ -169,6 +211,8 @@ Add a device to the devices file.
.br
.RS 4
.ad l
+[ \fB--deviceidtype\fP \fIString\fP ]
+.br
[ COMMON_OPTIONS ]
.ad b
.RE
@@ -214,13 +258,6 @@ Remove the devices file entry for the given PVID.
.P
\(em
.P
-Common options for command:
-.
-.RS 4
-.ad l
-.ad b
-.RE
-.P
Common options for lvm:
.
.RS 4
@@ -308,6 +345,13 @@ Remove a device from the devices file.
Remove a device with the PVID from the devices file.
.
.HP
+\fB--deviceidtype\fP \fIString\fP
+.br
+The type of device ID to use for the device.
+If the specified type is available for the device,
+then it will override the default type that lvm would use.
+.
+.HP
\fB--devices\fP \fIPV\fP
.br
Devices that the command can use. This option can be repeated
diff --git a/man/vgchange.8_pregen b/man/vgchange.8_pregen
index 857dabf04..31fc458da 100644
--- a/man/vgchange.8_pregen
+++ b/man/vgchange.8_pregen
@@ -393,13 +393,6 @@ Change the lock type for a shared VG.
.P
\(em
.P
-Common options for command:
-.
-.RS 4
-.ad l
-.ad b
-.RE
-.P
Common options for lvm:
.
.RS 4
diff --git a/man/vgck.8_pregen b/man/vgck.8_pregen
index f177dfbdd..ae312424a 100644
--- a/man/vgck.8_pregen
+++ b/man/vgck.8_pregen
@@ -46,13 +46,6 @@ Rewrite VG metadata to correct problems.
.ad b
.RE
.P
-Common options for command:
-.
-.RS 4
-.ad l
-.ad b
-.RE
-.P
Common options for lvm:
.
.RS 4
2 years, 5 months
master - vdo: support vdo_pool_header_size
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2c6a2b6e86b57aeb96e...
Commit: 2c6a2b6e86b57aeb96e93618193426ee129b00a6
Parent: 5fcbc3bd7d3473f14e556508fff1b381431c59f0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 28 17:53:08 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jun 28 20:41:07 2021 +0200
vdo: support vdo_pool_header_size
Add profilable configurable setting for vdo pool header size, that is
used as 'extra' empty space at the front and end of vdo-pool device
to avoid having a disk in the system the may have same data is real
vdo LV.
For some conversion cases however we may need to allow using '0' header size.
TODO: in this case we may eventually avoid adding 'linear' mapping layer
in future - but this requires further modification over lvm code base.
---
conf/example.conf.in | 5 +++++
lib/config/config_settings.h | 3 +++
lib/config/defaults.h | 3 +--
lib/metadata/lv_manip.c | 3 ++-
lib/metadata/metadata-exported.h | 5 ++++-
lib/metadata/vdo_manip.c | 13 ++++++++-----
tools/lvconvert.c | 6 ++++--
tools/lvcreate.c | 2 +-
8 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index 16b49a495..50cf6f42b 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -733,6 +733,11 @@ allocation {
# The default and minimum is 1. The maximum is UINT_MAX / 4096.
# This configuration option has an automatic default value.
# vdo_max_discard = 1
+
+ # Configuration option allocation/vdo_pool_header_size.
+ # Specified the emptry header size in KiB at the front and end of vdo pool device.
+ # This configuration option has an automatic default value.
+ # vdo_pool_header_size = 512
}
# Configuration section log.
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index fe14a1eb2..d66a9a3a7 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -816,6 +816,9 @@ cfg(allocation_vdo_max_discard_CFG, "vdo_max_discard", allocation_CFG_SECTION, C
"increased latency for the individual discard requests.\n"
"The default and minimum is 1. The maximum is UINT_MAX / 4096.\n")
+cfg(allocation_vdo_pool_header_size_CFG, "vdo_pool_header_size", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_POOL_HEADER_SIZE_KB, vsn(2, 3, 12), NULL, 0, NULL,
+ "Specified the emptry header size in KiB at the front and end of vdo pool device.\n")
+
cfg(log_report_command_log_CFG, "report_command_log", log_CFG_SECTION, CFG_PROFILABLE | CFG_DEFAULT_COMMENTED | CFG_DISALLOW_INTERACTIVE, CFG_TYPE_BOOL, DEFAULT_COMMAND_LOG_REPORT, vsn(2, 2, 158), NULL, 0, NULL,
"Enable or disable LVM log reporting.\n"
"If enabled, LVM will collect a log of operations, messages,\n"
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 2870dee12..d5e5b3b1a 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -181,8 +181,7 @@
* VDO pool will reverve some sectors in the front and the back of pool device to avoid
* seeing same device twice in the system.
*/
-#define DEFAULT_VDO_POOL_HEADER_SIZE (1024) // 512KiB
-
+#define DEFAULT_VDO_POOL_HEADER_SIZE_KB (512)
#define DEFAULT_FSADM_PATH FSADM_PATH
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index eb92d6eca..7e66afd9c 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -8739,7 +8739,8 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
}
if (seg_is_vdo_pool(lp)) {
- if (!convert_vdo_pool_lv(lv, &lp->vdo_params, &lp->virtual_extents, 1)) {
+ if (!convert_vdo_pool_lv(lv, &lp->vdo_params, &lp->virtual_extents,
+ 1, lp->vdo_pool_header_size)) {
stack;
goto deactivate_and_revert_new_lv;
}
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 9ac3c677e..96a9533d2 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -1034,6 +1034,7 @@ struct lvcreate_params {
int approx_alloc; /* all */
alloc_policy_t alloc; /* all */
struct dm_vdo_target_params vdo_params; /* vdo */
+ uint64_t vdo_pool_header_size; /* VDO */
int raidintegrity;
const char *raidintegritymode;
@@ -1368,10 +1369,12 @@ int parse_vdo_pool_status(struct dm_pool *mem, const struct logical_volume *vdo_
struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
const struct dm_vdo_target_params *vtp,
uint32_t *virtual_extents,
- int format);
+ int format,
+ uint64_t vdo_pool_header_size);
int set_vdo_write_policy(enum dm_vdo_write_policy *vwp, const char *policy);
int fill_vdo_target_params(struct cmd_context *cmd,
struct dm_vdo_target_params *vtp,
+ uint64_t *vdo_pool_header_size,
struct profile *profile);
/* -- metadata/vdo_manip.c */
diff --git a/lib/metadata/vdo_manip.c b/lib/metadata/vdo_manip.c
index afc513ae5..3f2de1a01 100644
--- a/lib/metadata/vdo_manip.c
+++ b/lib/metadata/vdo_manip.c
@@ -356,9 +356,9 @@ static int _format_vdo_pool_data_lv(struct logical_volume *data_lv,
struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
const struct dm_vdo_target_params *vtp,
uint32_t *virtual_extents,
- int format)
+ int format,
+ uint64_t vdo_pool_header_size)
{
- const uint64_t header_size = DEFAULT_VDO_POOL_HEADER_SIZE;
const uint32_t extent_size = data_lv->vg->extent_size;
struct cmd_context *cmd = data_lv->vg->cmd;
struct logical_volume *vdo_pool_lv = data_lv;
@@ -379,7 +379,7 @@ struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
if (*virtual_extents)
vdo_logical_size =
- _get_virtual_size(*virtual_extents, extent_size, header_size);
+ _get_virtual_size(*virtual_extents, extent_size, vdo_pool_header_size);
if (!dm_vdo_validate_target_params(vtp, vdo_logical_size))
return_0;
@@ -403,7 +403,7 @@ struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
return NULL;
}
- vdo_logical_size -= 2 * header_size;
+ vdo_logical_size -= 2 * vdo_pool_header_size;
if (vdo_logical_size < extent_size) {
if (!*virtual_extents)
@@ -426,7 +426,7 @@ struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
vdo_pool_seg = first_seg(vdo_pool_lv);
vdo_pool_seg->segtype = vdo_pool_segtype;
vdo_pool_seg->vdo_params = *vtp;
- vdo_pool_seg->vdo_pool_header_size = DEFAULT_VDO_POOL_HEADER_SIZE;
+ vdo_pool_seg->vdo_pool_header_size = vdo_pool_header_size;
vdo_pool_seg->vdo_pool_virtual_extents = *virtual_extents;
vdo_pool_lv->status |= LV_VDO_POOL;
@@ -453,6 +453,7 @@ int set_vdo_write_policy(enum dm_vdo_write_policy *vwp, const char *policy)
int fill_vdo_target_params(struct cmd_context *cmd,
struct dm_vdo_target_params *vtp,
+ uint64_t *vdo_pool_header_size,
struct profile *profile)
{
const char *policy;
@@ -501,5 +502,7 @@ int fill_vdo_target_params(struct cmd_context *cmd,
if (!set_vdo_write_policy(&vtp->write_policy, policy))
return_0;
+ *vdo_pool_header_size = 2 * find_config_tree_int64(cmd, allocation_vdo_pool_header_size_CFG, profile);
+
return 1;
}
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 19b3c587e..7fbe84952 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -5405,6 +5405,7 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
{
const char *vg_name = NULL;
unsigned int vdo_pool_zero;
+ uint64_t vdo_pool_header_size;
struct volume_group *vg = lv->vg;
struct logical_volume *vdo_lv;
struct dm_vdo_target_params vdo_params; /* vdo */
@@ -5447,7 +5448,7 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
goto out;
}
- if (!fill_vdo_target_params(cmd, &vdo_params, vg->profile))
+ if (!fill_vdo_target_params(cmd, &vdo_params, &vdo_pool_header_size, vg->profile))
goto_out;
if (arg_is_set(cmd, compression_ARG))
@@ -5489,7 +5490,8 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
}
}
- if (!convert_vdo_pool_lv(lv, &vdo_params, &lvc.virtual_extents, vdo_pool_zero))
+ if (!convert_vdo_pool_lv(lv, &vdo_params, &lvc.virtual_extents,
+ vdo_pool_zero, vdo_pool_header_size))
goto_out;
dm_list_init(&lvc.tags);
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index a28f0931e..0def23639 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -1097,7 +1097,7 @@ static int _lvcreate_params(struct cmd_context *cmd,
// FIXME: prefiling here - this is wrong place
// but will work for this moment
- if (!fill_vdo_target_params(cmd, &lp->vdo_params, NULL))
+ if (!fill_vdo_target_params(cmd, &lp->vdo_params, &lp->vdo_pool_header_size, NULL))
return_0;
if (arg_is_set(cmd, compression_ARG))
2 years, 5 months
master - vdo: rename variable vdo_pool_zero
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5fcbc3bd7d3473f14e5...
Commit: 5fcbc3bd7d3473f14e556508fff1b381431c59f0
Parent: 6e773bb196d7e45fbecf0619f8993e6cf4534fa2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 28 17:54:55 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jun 28 20:41:07 2021 +0200
vdo: rename variable vdo_pool_zero
Match rest of code.
---
tools/lvconvert.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index ab8b42b7e..19b3c587e 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -5404,7 +5404,7 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
struct processing_handle *handle)
{
const char *vg_name = NULL;
- unsigned int zero_vdopool;
+ unsigned int vdo_pool_zero;
struct volume_group *vg = lv->vg;
struct logical_volume *vdo_lv;
struct dm_vdo_target_params vdo_params; /* vdo */
@@ -5463,12 +5463,12 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
goto out;
}
- zero_vdopool = arg_int_value(cmd, zero_ARG, 1);
+ vdo_pool_zero = arg_int_value(cmd, zero_ARG, 1);
log_warn("WARNING: Converting logical volume %s to VDO pool volume %s formating.",
- display_lvname(lv), zero_vdopool ? "with" : "WITHOUT");
+ display_lvname(lv), vdo_pool_zero ? "with" : "WITHOUT");
- if (zero_vdopool)
+ if (vdo_pool_zero)
log_warn("THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)");
else
log_warn("WARNING: Using invalid VDO pool data MAY DESTROY YOUR DATA!");
@@ -5480,7 +5480,7 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
goto out;
}
- if (zero_vdopool) {
+ if (vdo_pool_zero) {
if (!wipe_lv(lv, (struct wipe_params) { .do_zero = 1, .do_wipe_signatures = 1,
.yes = arg_count(cmd, yes_ARG),
.force = arg_count(cmd, force_ARG)})) {
@@ -5489,7 +5489,7 @@ static int _lvconvert_to_vdopool_single(struct cmd_context *cmd,
}
}
- if (!convert_vdo_pool_lv(lv, &vdo_params, &lvc.virtual_extents, zero_vdopool))
+ if (!convert_vdo_pool_lv(lv, &vdo_params, &lvc.virtual_extents, vdo_pool_zero))
goto_out;
dm_list_init(&lvc.tags);
2 years, 5 months
master - lvconvert: fix vdo virtual size when specified
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6e773bb196d7e45fbec...
Commit: 6e773bb196d7e45fbecf0619f8993e6cf4534fa2
Parent: d9cb1d398320420280cd7dde28fca77d2459457c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 28 18:12:19 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jun 28 20:41:07 2021 +0200
lvconvert: fix vdo virtual size when specified
Correctly use virtual size specified by:
lvconvert --type vdo-pool --virtualsize
---
lib/metadata/vdo_manip.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/metadata/vdo_manip.c b/lib/metadata/vdo_manip.c
index 7d5a2cb5a..afc513ae5 100644
--- a/lib/metadata/vdo_manip.c
+++ b/lib/metadata/vdo_manip.c
@@ -393,7 +393,8 @@ struct logical_volume *convert_vdo_pool_lv(struct logical_volume *data_lv,
} else {
log_verbose("Skiping VDO formating %s.", display_lvname(data_lv));
/* TODO: parse existing VDO data and retrieve vdo_logical_size */
- vdo_logical_size = data_lv->size;
+ if (!*virtual_extents)
+ vdo_logical_size = data_lv->size;
}
if (!deactivate_lv(data_lv->vg->cmd, data_lv)) {
2 years, 5 months
master - config_settings: typo fix
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d9cb1d398320420280c...
Commit: d9cb1d398320420280cd7dde28fca77d2459457c
Parent: 73a05c8f02e9e4575b1ffceebc3a907f2e43517b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 28 17:48:01 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jun 28 18:11:14 2021 +0200
config_settings: typo fix
---
conf/example.conf.in | 2 +-
lib/config/config_settings.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index b4a55ae6a..16b49a495 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -723,7 +723,7 @@ allocation {
# vdo_write_policy = "auto"
# Configuration option allocation/vdo_max_discard.
- # Specified te maximum size of discard bio accepted, in 4096 byte blocks.
+ # Specified the maximum size of discard bio accepted, in 4096 byte blocks.
# I/O requests to a VDO volume are normally split into 4096-byte blocks,
# and processed up to 2048 at a time. However, discard requests to a VDO volume
# can be automatically split to a larger size, up to <max discard> 4096-byte blocks
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index d3a42a153..fe14a1eb2 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -807,7 +807,7 @@ cfg(allocation_vdo_write_policy_CFG, "vdo_write_policy", allocation_CFG_SECTION,
" Data which has not been flushed is not guaranteed to persist in this mode.\n")
cfg(allocation_vdo_max_discard_CFG, "vdo_max_discard", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_MAX_DISCARD, VDO_1ST_VSN, NULL, 0, NULL,
- "Specified te maximum size of discard bio accepted, in 4096 byte blocks.\n"
+ "Specified the maximum size of discard bio accepted, in 4096 byte blocks.\n"
"I/O requests to a VDO volume are normally split into 4096-byte blocks,\n"
"and processed up to 2048 at a time. However, discard requests to a VDO volume\n"
"can be automatically split to a larger size, up to <max discard> 4096-byte blocks\n"
2 years, 5 months
main - device_id: handle qemu wwid
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=73a05c8f02e9e4575b1...
Commit: 73a05c8f02e9e4575b1ffceebc3a907f2e43517b
Parent: 84bd394cf9aaa581b4bf980f764544dda26a0305
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Jun 24 11:30:46 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Jun 24 11:30:46 2021 -0500
device_id: handle qemu wwid
Ignore made-up wwid values reported for qemu devices
that contain the string "QEMU HARDDISK". The devname
will be used as the device id.
---
lib/device/device_id.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index ffeac3064..87a46a73a 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -312,6 +312,10 @@ const char *device_id_system_read(struct cmd_context *cmd, struct device *dev, u
/* scsi_debug wwid begins "t10.Linux scsi_debug ..." */
if (strstr(sysbuf, "scsi_debug"))
sysbuf[0] = '\0';
+
+ /* qemu wwid begins "t10.ATA QEMU HARDDISK ..." */
+ if (strstr(sysbuf, "QEMU HARDDISK"))
+ sysbuf[0] = '\0';
}
else if (idtype == DEV_ID_TYPE_SYS_SERIAL)
2 years, 5 months
main - writecache: use block size 4096 when no fs is found
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=84bd394cf9aaa581b4b...
Commit: 84bd394cf9aaa581b4bf980f764544dda26a0305
Parent: 1139a05939f85bd86a756b451a8f194bc7a72a2c
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jun 23 12:38:57 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jun 23 12:38:57 2021 -0500
writecache: use block size 4096 when no fs is found
When there is no block size constraint from a file system
or from a user setting, use 4096 rather than 512 because of
better performance.
---
tools/lvconvert.c | 23 +++++------------------
1 file changed, 5 insertions(+), 18 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index cbe4fa93a..ab8b42b7e 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -5992,24 +5992,13 @@ static int _set_writecache_block_size(struct cmd_context *cmd,
rv = get_fs_block_size(pathname, &fs_block_size);
skip_fs:
if (!rv || !fs_block_size) {
- if (lbs_4k && pbs_4k && !pbs_512) {
+ if (block_size_setting)
+ block_size = block_size_setting;
+ else
block_size = 4096;
- } else if (lbs_512 && pbs_512 && !pbs_4k) {
- block_size = 512;
- } else if (lbs_512 && pbs_4k) {
- if (block_size_setting == 4096)
- block_size = 4096;
- else
- block_size = 512;
- } else {
- block_size = 512;
- }
- if (block_size_setting && (block_size_setting != block_size)) {
- log_warn("WARNING: writecache block size %u does not match device block sizes, logical %u physical %u",
- block_size_setting, lbs_4k ? 4096 : 512, pbs_4k ? 4096 : 512);
- block_size = block_size_setting;
- }
+ log_print("Using writecache block size %u for unknown file system block size, logical block size %u, physical block size %u.",
+ block_size, lbs_4k ? 4096 : 512, pbs_4k ? 4096 : 512);
if (block_size != 512) {
log_warn("WARNING: unable to detect a file system block size on %s", display_lvname(lv));
@@ -6021,8 +6010,6 @@ skip_fs:
}
}
- log_print("Using writecache block size %u for unknown file system block size, logical block size %u, physical block size %u.",
- block_size, lbs_4k ? 4096 : 512, pbs_4k ? 4096 : 512);
goto out;
}
2 years, 5 months
main - device_id: handle scsi_debug wwid
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1139a05939f85bd86a7...
Commit: 1139a05939f85bd86a756b451a8f194bc7a72a2c
Parent: c35f7722d588009edad22d59c68c82150bb5c216
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Jun 22 13:36:10 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Jun 22 13:36:10 2021 -0500
device_id: handle scsi_debug wwid
Ignore the wwid value reported by scsi_debug devices
that begin "t10.Linux scsi_debug". The devname
will be used as the device id.
---
lib/device/device_id.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index 65912b9b6..ffeac3064 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -308,6 +308,10 @@ const char *device_id_system_read(struct cmd_context *cmd, struct device *dev, u
if (!sysbuf[0])
_read_sys_block(cmd, dev, "wwid", sysbuf, sizeof(sysbuf));
+
+ /* scsi_debug wwid begins "t10.Linux scsi_debug ..." */
+ if (strstr(sysbuf, "scsi_debug"))
+ sysbuf[0] = '\0';
}
else if (idtype == DEV_ID_TYPE_SYS_SERIAL)
2 years, 5 months