master - vgck: let updatemetadata repair mismatched metadata
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bd21736e8b082319e1a...
Commit: bd21736e8b082319e1a9a29e75badd906ee277f6
Parent: d6ffc990523468e46ae03a462ef1ec73067f9934
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Oct 8 14:44:24 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Oct 11 12:57:39 2019 -0500
vgck: let updatemetadata repair mismatched metadata
Let vgck --updatemetadata repair cases where different mdas
hold indepedently valid but unmatching copies of the metadata,
i.e. different text metadata checksums or text metadata sizes.
---
lib/cache/lvmcache.c | 1 +
lib/cache/lvmcache.h | 1 +
lib/format_text/text_label.c | 25 +++++++++++++++++++------
lib/metadata/metadata.c | 3 +++
lib/metadata/metadata.h | 1 +
5 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 316624f..f6e7924 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1649,6 +1649,7 @@ int lvmcache_update_vgname_and_id(struct lvmcache_info *info, struct lvmcache_vg
vgsummary->mda_checksum, vgsummary->mda_size,
vginfo->mda_checksum, vginfo->mda_size);
vginfo->scan_summary_mismatch = true;
+ vgsummary->mismatch = 1;
return 0;
}
diff --git a/lib/cache/lvmcache.h b/lib/cache/lvmcache.h
index 1401974..d614e54 100644
--- a/lib/cache/lvmcache.h
+++ b/lib/cache/lvmcache.h
@@ -58,6 +58,7 @@ struct lvmcache_vgsummary {
int mda_num; /* 1 = summary from mda1, 2 = summary from mda2 */
unsigned mda_ignored:1;
unsigned zero_offset:1;
+ unsigned mismatch:1; /* lvmcache sets if this summary differs from previous values */
struct dm_list pvsummaries;
};
diff --git a/lib/format_text/text_label.c b/lib/format_text/text_label.c
index 41276be..246fb7b 100644
--- a/lib/format_text/text_label.c
+++ b/lib/format_text/text_label.c
@@ -507,10 +507,17 @@ static int _text_read(struct labeller *labeller, struct device *dev, void *label
if (rv1 && !vgsummary.zero_offset && !vgsummary.mda_ignored) {
if (!lvmcache_update_vgname_and_id(info, &vgsummary)) {
/* I believe this is only an internal error. */
- log_warn("WARNING: Scanning %s mda1 failed to save internal summary.", dev_name(dev));
dm_list_del(&mda1->list);
- bad_fields |= BAD_MDA_INTERNAL;
+
+ /* Are there other cases besides mismatch and internal error? */
+ if (vgsummary.mismatch) {
+ log_warn("WARNING: Scanning %s mda1 found mismatch with other metadata.", dev_name(dev));
+ bad_fields |= BAD_MDA_MISMATCH;
+ } else {
+ log_warn("WARNING: Scanning %s mda1 failed to save internal summary.", dev_name(dev));
+ bad_fields |= BAD_MDA_INTERNAL;
+ }
mda1->bad_fields = bad_fields;
lvmcache_save_bad_mda(info, mda1);
mda1 = NULL;
@@ -550,11 +557,17 @@ static int _text_read(struct labeller *labeller, struct device *dev, void *label
if (rv2 && !vgsummary.zero_offset && !vgsummary.mda_ignored) {
if (!lvmcache_update_vgname_and_id(info, &vgsummary)) {
- /* I believe this is only an internal error. */
- log_warn("WARNING: Scanning %s mda2 failed to save internal summary.", dev_name(dev));
-
dm_list_del(&mda2->list);
- bad_fields |= BAD_MDA_INTERNAL;
+
+ /* Are there other cases besides mismatch and internal error? */
+ if (vgsummary.mismatch) {
+ log_warn("WARNING: Scanning %s mda2 found mismatch with other metadata.", dev_name(dev));
+ bad_fields |= BAD_MDA_MISMATCH;
+ } else {
+ log_warn("WARNING: Scanning %s mda2 failed to save internal summary.", dev_name(dev));
+ bad_fields |= BAD_MDA_INTERNAL;
+ }
+
mda2->bad_fields = bad_fields;
lvmcache_save_bad_mda(info, mda2);
mda2 = NULL;
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 39544e6..b09f4b3 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4518,6 +4518,9 @@ void vg_write_commit_bad_mdas(struct cmd_context *cmd, struct volume_group *vg)
* above.
*
* TEXT: general error related to text metadata, we can repair.
+ *
+ * MISMATCH: different values between instances of metadata,
+ * can repair.
*/
if (!mda->bad_fields ||
(mda->bad_fields & BAD_MDA_READ) ||
diff --git a/lib/metadata/metadata.h b/lib/metadata/metadata.h
index 6516e62..ac18879 100644
--- a/lib/metadata/metadata.h
+++ b/lib/metadata/metadata.h
@@ -179,6 +179,7 @@ struct metadata_area_ops {
#define BAD_MDA_MAGIC 0x00000020
#define BAD_MDA_VERSION 0x00000040
#define BAD_MDA_START 0x00000080
+#define BAD_MDA_MISMATCH 0x00000100 /* lvmcache found difference from prev metadata */
struct metadata_area {
struct dm_list list;
4 years, 6 months
master - pvmove: remove some cmirror related code
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fe16d296b058333fddd...
Commit: fe16d296b058333fddd5102afbebf95a18f85468
Parent: df26b73b8e4355df7f6d4d664edad2b86991b352
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 11 11:12:11 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Oct 11 11:31:42 2019 -0500
pvmove: remove some cmirror related code
which is no longer used
---
lib/metadata/metadata-exported.h | 2 -
lib/metadata/mirror.c | 41 +-------------------------------------
lib/mirror/mirrored.c | 30 ---------------------------
tools/pvmove.c | 14 +------------
4 files changed, 2 insertions(+), 85 deletions(-)
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 71e4c77..8239fed 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -1152,8 +1152,6 @@ int is_temporary_mirror_layer(const struct logical_volume *lv);
struct logical_volume * find_temporary_mirror(const struct logical_volume *lv);
uint32_t lv_mirror_count(const struct logical_volume *lv);
-/* Remove CMIRROR_REGION_COUNT_LIMIT when http://bugzilla.redhat.com/682771 is fixed */
-#define CMIRROR_REGION_COUNT_LIMIT (256*1024 * 8)
uint32_t adjusted_mirror_region_size(struct cmd_context *cmd,
uint32_t extent_size, uint32_t extents,
uint32_t region_size, int internal, int clustered);
diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c
index 8459457..75dc18c 100644
--- a/lib/metadata/mirror.c
+++ b/lib/metadata/mirror.c
@@ -161,8 +161,7 @@ uint32_t adjusted_mirror_region_size(struct cmd_context *cmd,
uint32_t extent_size, uint32_t extents,
uint32_t region_size, int internal, int clustered)
{
- uint64_t region_max, region_min;
- uint32_t region_min_pow2;
+ uint64_t region_max;
region_max = (uint64_t) extents * extent_size;
@@ -176,44 +175,6 @@ uint32_t adjusted_mirror_region_size(struct cmd_context *cmd,
display_size(cmd, region_size));
}
-#ifdef CMIRROR_REGION_COUNT_LIMIT
- if (clustered) {
- /*
- * The CPG code used by cluster mirrors can only handle a
- * payload of < 1MB currently. (This deficiency is tracked by
- * http://bugzilla.redhat.com/682771.) The region size for cluster
- * mirrors must be restricted in such a way as to limit the
- * size of the bitmap to < 512kB, because there are two bitmaps
- * which get sent around during checkpointing while a cluster
- * mirror starts up. Ergo, the number of regions must not
- * exceed 512k * 8. We also need some room for the other
- * checkpointing structures as well, so we reduce by another
- * factor of two.
- *
- * This code should be removed when the CPG restriction is
- * lifted.
- */
- region_min = region_max / CMIRROR_REGION_COUNT_LIMIT;
- if (region_min > UINT32_MAX / 2) {
- log_error("Can't find proper region size for too big mirror.");
- return 0;
- }
- region_min_pow2 = UINT64_C(1) << (1 + 31 - clz(region_min));
-
- if (region_size < region_min_pow2) {
- if (internal)
- log_print_unless_silent("Increasing mirror region size from %s to %s",
- display_size(cmd, region_size),
- display_size(cmd, region_min_pow2));
- else
- log_verbose("Increasing mirror region size from %s to %s",
- display_size(cmd, region_size),
- display_size(cmd, region_min_pow2));
- region_size = region_min_pow2;
- }
- }
-#endif /* CMIRROR_REGION_COUNT_LIMIT */
-
return region_size;
}
diff --git a/lib/mirror/mirrored.c b/lib/mirror/mirrored.c
index aaaa0b8..75893a6 100644
--- a/lib/mirror/mirrored.c
+++ b/lib/mirror/mirrored.c
@@ -429,40 +429,10 @@ static int _mirrored_target_present(struct cmd_context *cmd,
sscanf(vsn, "%u.%u.%u", &maj2, &min2, &patchlevel2) == 3 &&
maj2 == 4 && min2 == 5 && patchlevel2 == 0))) /* RHEL4U3 */
_block_on_error_available = 1;
-
-#ifdef CMIRRORD_PIDFILE
- /*
- * The cluster mirror log daemon must be running,
- * otherwise, the kernel module will fail to make
- * contact.
- */
- if (cmirrord_is_running()) {
- struct utsname uts;
- unsigned kmaj, kmin, krel;
- /*
- * The dm-log-userspace module was added to the
- * 2.6.31 kernel.
- */
- if (!uname(&uts) &&
- (sscanf(uts.release, "%u.%u.%u", &kmaj, &kmin, &krel) == 3) &&
- KERNEL_VERSION(kmaj, kmin, krel) < KERNEL_VERSION(2, 6, 31)) {
- if (module_present(cmd, MODULE_NAME_LOG_CLUSTERED))
- _mirror_attributes |= MIRROR_LOG_CLUSTERED;
- } else if (module_present(cmd, MODULE_NAME_LOG_USERSPACE))
- _mirror_attributes |= MIRROR_LOG_CLUSTERED;
-
- if (!(_mirror_attributes & MIRROR_LOG_CLUSTERED))
- log_verbose("Cluster mirror log module is not available.");
- } else
- log_verbose("Cluster mirror log daemon is not running.");
-#else
- log_verbose("Cluster mirror log daemon not included in build.");
-#endif
}
/*
* Check only for modules if atttributes requested and no previous check.
- * FIXME: Fails incorrectly if cmirror was built into kernel.
*/
if (attributes)
*attributes = _mirror_attributes;
diff --git a/tools/pvmove.c b/tools/pvmove.c
index ebbdb4c..674decf 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -40,27 +40,15 @@ struct pvmove_params {
static int _pvmove_target_present(struct cmd_context *cmd, int clustered)
{
const struct segment_type *segtype;
- unsigned attr = 0;
int found = 1;
- static int _clustered_found = -1;
-
- if (clustered && _clustered_found >= 0)
- return _clustered_found;
if (!(segtype = get_segtype_from_string(cmd, SEG_TYPE_NAME_MIRROR)))
return_0;
if (activation() && segtype->ops->target_present &&
- !segtype->ops->target_present(cmd, NULL, clustered ? &attr : NULL))
+ !segtype->ops->target_present(cmd, NULL, NULL))
found = 0;
- if (activation() && clustered) {
- if (found && (attr & MIRROR_LOG_CLUSTERED))
- _clustered_found = found = 1;
- else
- _clustered_found = found = 0;
- }
-
return found;
}
4 years, 6 months
master - test: Minimize data written by metadata-zero-space
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=df26b73b8e4355df7f6...
Commit: df26b73b8e4355df7f6d4d664edad2b86991b352
Parent: 53b97b146df4de99207c580c1304d016832e318b
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Wed Oct 9 15:11:03 2019 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Oct 9 15:11:03 2019 +0200
test: Minimize data written by metadata-zero-space
The test is checking only 2 megabytes, but is rewriting much more. Bad
for limited ramdisk.
---
test/shell/metadata-zero-space.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/test/shell/metadata-zero-space.sh b/test/shell/metadata-zero-space.sh
index 1bd1eef..d037ab2 100644
--- a/test/shell/metadata-zero-space.sh
+++ b/test/shell/metadata-zero-space.sh
@@ -21,7 +21,8 @@ get_devs
# Fill with random data so if the space between metadata
# copies are not zeroed the grep for zeros will fail.
-dd if=/dev/urandom of="$dev1" bs=1M || true
+dd if=/dev/urandom of="$dev1" bs=1M count=1 || true
+dd if=/dev/urandom of="$dev1" bs=1M skip=15 count=1 || true
pvcreate --pvmetadatacopies 2 "$dev1"
4 years, 6 months
master - man: lvmcache note dm-cache block size issue
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=53b97b146df4de99207...
Commit: 53b97b146df4de99207c580c1304d016832e318b
Parent: b6240c91882a98df9eceab0312eec893b7051765
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Oct 8 09:59:38 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Oct 8 09:59:38 2019 -0500
man: lvmcache note dm-cache block size issue
---
man/lvmcache.7_main | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/man/lvmcache.7_main b/man/lvmcache.7_main
index 9f3e526..0eefc89 100644
--- a/man/lvmcache.7_main
+++ b/man/lvmcache.7_main
@@ -140,6 +140,21 @@ metadata.) This can be used with dm-cache.
\&
+.SS dm-cache block size
+
+\&
+
+A cache pool will have a logical block size of 4096 bytes if it is created
+on a device with a logical block size of 4096 bytes.
+
+If a main LV has logical block size 512 (with an existing xfs file system
+using that size), then it cannot use a cache pool with a 4096 logical
+block size. If the cache pool is attached, the main LV will likely fail
+to mount.
+
+To avoid this problem, use a mkfs option to specify a 4096 block size for
+the file system, or attach the cache pool before running mkfs.
+
.SS dm-writecache block size
\&
4 years, 6 months
master - vgremove: remove internal lvmlock LV
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b6240c91882a98df9ec...
Commit: b6240c91882a98df9eceab0312eec893b7051765
Parent: a22729a5577689d896ea13a82e6af7f7dde30412
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 4 12:01:30 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Oct 4 12:01:30 2019 -0500
vgremove: remove internal lvmlock LV
If a VG is forcibly changed from lock_type sanlock to
lock_type none, the internal lvmlock LV is left behind.
If that LV is not removed before vgremove is run on the
VG, then an internal check will be triggered by the
hidden lvmlock LV. So, check for and remove a left over
lvmlock LV during vgremove.
---
lib/locking/lvmlockd.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index 612de5d..bdd567d 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -374,6 +374,7 @@ static int _remove_sanlock_lv(struct cmd_context *cmd, struct volume_group *vg)
return 0;
}
+ log_debug("sanlock lvmlock LV removed");
return 1;
}
@@ -1028,6 +1029,13 @@ int lockd_free_vg_before(struct cmd_context *cmd, struct volume_group *vg,
switch (lock_type_num) {
case LOCK_TYPE_NONE:
+ /*
+ * If a sanlock VG was forcibly changed to none,
+ * the sanlock_lv may have been left behind.
+ */
+ if (vg->sanlock_lv)
+ _remove_sanlock_lv(cmd, vg);
+ return 1;
case LOCK_TYPE_CLVM:
return 1;
case LOCK_TYPE_DLM:
4 years, 7 months
master - tests: improve lib wipefs_a
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a22729a5577689d896e...
Commit: a22729a5577689d896ea13a82e6af7f7dde30412
Parent: 414f903cdc161e553100af6ad03e68fbf94617c3
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 4 11:04:44 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Oct 4 11:06:38 2019 -0500
tests: improve lib wipefs_a
in wipefs fallback, use limited dd and mdadm --zero-superblock
to avoid writing to entire dev in case dev space is provisioned
on write.
---
test/lib/aux.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 8ceb5db..36e1c2b 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -804,7 +804,8 @@ wipefs_a() {
if wipefs -V >/dev/null; then
wipefs -a "$dev"
else
- dd if=/dev/zero of="$dev" bs=1024 || true
+ dd if=/dev/zero of="$dev" bs=4096 count=8 || true
+ mdadm --zero-superblock "$dev" || true
fi
}
4 years, 7 months
master - WHATS_NEW: update
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=414f903cdc161e55310...
Commit: 414f903cdc161e553100af6ad03e68fbf94617c3
Parent: ca70dc4540571bde2d10f4506f865e1caf398f00
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 4 17:30:52 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 4 17:31:55 2019 +0200
WHATS_NEW: update
---
WHATS_NEW | 6 ++++++
WHATS_NEW_DM | 1 +
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index a9bd750..767973c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,11 @@
Version 2.03.06 -
================================
+ Extend lvs to show all VDO properties.
+ Preserve VDO write policy with vdopool.
+ Increase default vdo bio threads to 4.
+ Continue report when cache_status fails.
+ Add support for DM_GET_TARGET_VERSION into device_mapper.
+ Fix cmirrord usage of header files from device_mapper subdir.
Allow standalone activation of VDO pool just like for thin-pools.
Activate thin-pool layered volume as 'read-only' device.
Ignore crypto devices with UUID signature CRYPT-SUBDEV.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 60a2b53..94492d4 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.165 -
=================================
+ Add support for DM_GET_TARGET_VERSION.
Add debug of dmsetup udevcomplete with hexa print DM_COOKIE_COMPLETED.
Fix versioning of dm_stats_create_region and dm_stats_create_region.
4 years, 7 months
master - vdo: add lvs fields to query vdo volume properties
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ca70dc4540571bde2d1...
Commit: ca70dc4540571bde2d10f4506f865e1caf398f00
Parent: 862aa06e5eb28c0a9a163f109bdaeba9729243bc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 4 17:02:20 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 4 17:31:55 2019 +0200
vdo: add lvs fields to query vdo volume properties
Add lots of vdo fields:
vdo_operating_mode - For vdo pools, its current operating mode.
vdo_compression_state - For vdo pools, whether compression is running.
vdo_index_state - For vdo pools, state of index for deduplication.
vdo_used_size - For vdo pools, currently used space.
vdo_saving_percent - For vdo pools, percentage of saved space.
vdo_compression - Set for compressed LV (vdopool).
vdo_deduplication - Set for deduplicated LV (vdopool).
vdo_use_metadata_hints - Use REQ_SYNC for writes (vdopool).
vdo_minimum_io_size - Minimum acceptable IO size (vdopool).
vdo_block_map_cache_size - Allocated caching size (vdopool).
vdo_block_map_era_length - Speed of cache writes (vdopool).
vdo_use_sparse_index - Sparse indexing (vdopool).
vdo_index_memory_size - Allocated indexing memory (vdopool).
vdo_slab_size - Increment size for growing (vdopool).
vdo_ack_threads - Acknowledging threads (vdopool).
vdo_bio_threads - IO submitting threads (vdopool).
vdo_bio_rotation - IO enqueue (vdopool).
vdo_cpu_threads - CPU threads for compression and hashing (vdopool).
vdo_hash_zone_threads - Threads for subdivide parts (vdopool).
vdo_logical_threads - Logical threads for subdivide parts (vdopool).
vdo_physical_threads - Physical threads for subdivide parts (vdopool).
vdo_max_discard - Maximum discard size volume can recieve (vdopool).
vdo_write_policy - Specified write policy (vdopool).
vdo_header_size - Header size at front of vdopool.
Previously only 'lvdisplay -m' was exposing them.
---
lib/report/columns.h | 28 +++++-
lib/report/properties.c | 49 ++++++++++
lib/report/report.c | 244 ++++++++++++++++++++++++++++++++++++++++++++++-
lib/report/values.h | 5 +
4 files changed, 324 insertions(+), 2 deletions(-)
diff --git a/lib/report/columns.h b/lib/report/columns.h
index 6f0f638..0a89451 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2017 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2019 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@@ -146,6 +146,11 @@ FIELD(LVSSTATUS, lv, STR, "KDiscards", lvid, 0, kdiscards, kernel_discards, "For
FIELD(LVSSTATUS, lv, BIN, "CheckNeeded", lvid, 15, lvcheckneeded, lv_check_needed, "For thin pools and cache volumes, whether metadata check is needed.", 0)
FIELD(LVSSTATUS, lv, BIN, "MergeFailed", lvid, 15, lvmergefailed, lv_merge_failed, "Set if snapshot merge failed.", 0)
FIELD(LVSSTATUS, lv, BIN, "SnapInvalid", lvid, 15, lvsnapshotinvalid, lv_snapshot_invalid, "Set if snapshot LV is invalid.", 0)
+FIELD(LVSSTATUS, lv, STR, "VDOOperatingMode", lvid, 0, vdo_operating_mode, vdo_operating_mode, "For vdo pools, its current operating mode.", 0)
+FIELD(LVSSTATUS, lv, STR, "VDOCompressionState", lvid, 0, vdo_compression_state, vdo_compression_state, "For vdo pools, whether compression is running.", 0)
+FIELD(LVSSTATUS, lv, STR, "VDOIndexState", lvid, 0, vdo_index_state, vdo_index_state, "For vdo pools, state of index for deduplication.", 0)
+FIELD(LVSSTATUS, lv, NUM, "VDOUsedSize", lvid, 0, vdo_used_size, vdo_used_size, "For vdo pools, currently used space.", 0)
+FIELD(LVSSTATUS, lv, NUM, "VDOSaving%", lvid, 0, vdo_saving_percent, vdo_saving_percent, "For vdo pools, percentage of saved space.", 0)
/*
* End of LVSSTATUS type fields
*/
@@ -274,6 +279,27 @@ FIELD(SEGS, seg, STR_LIST, "Metadata Devs", list, 0, metadatadevices, metadata_d
FIELD(SEGS, seg, STR, "Monitor", list, 0, segmonitor, seg_monitor, "Dmeventd monitoring status of the segment.", 0)
FIELD(SEGS, seg, STR, "CachePolicy", list, 0, cache_policy, cache_policy, "The cache policy (cached segments only).", 0)
FIELD(SEGS, seg, STR_LIST, "CacheSettings", list, 0, cache_settings, cache_settings, "Cache settings/parameters (cached segments only).", 0)
+
+FIELD(SEGS, seg, BIN, "VDOCompression", list, 0, vdo_compression, vdo_compression, "Set for compressed LV (vdopool).", 0)
+FIELD(SEGS, seg, BIN, "VDODeduplication", list, 0, vdo_deduplication, vdo_deduplication, "Set for deduplicated LV (vdopool).", 0)
+FIELD(SEGS, seg, BIN, "VDOMetadataHints", list, 0, vdo_use_metadata_hints, vdo_use_metadata_hints, "Use REQ_SYNC for writes (vdopool).", 0)
+FIELD(SEGS, seg, NUM, "VDOMinimumIOSize", list, 0, vdo_minimum_io_size, vdo_minimum_io_size, "Minimum acceptable IO size (vdopool).", 0)
+FIELD(SEGS, seg, SIZ, "VDOBlockMapCacheSize", list, 0, vdo_block_map_cache_size, vdo_block_map_cache_size, "Allocated caching size (vdopool).", 0)
+FIELD(SEGS, seg, NUM, "VDOBlockMapEraLength", list, 0, vdo_block_map_era_length, vdo_block_map_era_length, "Speed of cache writes (vdopool).", 0)
+FIELD(SEGS, seg, BIN, "VDOSparseIndex", list, 0, vdo_use_sparse_index, vdo_use_sparse_index, "Sparse indexing (vdopool).", 0)
+FIELD(SEGS, seg, SIZ, "VDOIndexMemorySize", list, 0, vdo_index_memory_size, vdo_index_memory_size, "Allocated indexing memory (vdopool).", 0)
+FIELD(SEGS, seg, SIZ, "VDOSlabSize", list, 0, vdo_slab_size, vdo_slab_size, "Increment size for growing (vdopool).", 0)
+FIELD(SEGS, seg, NUM, "VDOAckThreads", list, 0, vdo_ack_threads, vdo_ack_threads, "Acknowledging threads (vdopool).", 0)
+FIELD(SEGS, seg, NUM, "VDOBioThreads", list, 0, vdo_bio_threads, vdo_bio_threads, "IO submitting threads (vdopool).", 0)
+FIELD(SEGS, seg, NUM, "VDOBioRotation", list, 0, vdo_bio_rotation, vdo_bio_rotation, "IO enqueue (vdopool).", 0)
+FIELD(SEGS, seg, NUM, "VDOCPUThreads", list, 0, vdo_cpu_threads, vdo_cpu_threads, "CPU threads for compression and hashing (vdopool).", 0)
+FIELD(SEGS, seg, NUM, "VDOHashZoneThreads", list, 0, vdo_hash_zone_threads, vdo_hash_zone_threads, "Threads for subdivide parts (vdopool).", 0)
+FIELD(SEGS, seg, NUM, "VDOLogicalThreads", list, 0, vdo_logical_threads, vdo_logical_threads, "Logical threads for subdivide parts (vdopool).", 0)
+FIELD(SEGS, seg, NUM, "VDOPhysicalThreads", list, 0, vdo_physical_threads, vdo_physical_threads, "Physical threads for subdivide parts (vdopool).", 0)
+FIELD(SEGS, seg, NUM, "VDOMaxDiscard", list, 0, vdo_max_discard, vdo_max_discard, "Maximum discard size volume can recieve (vdopool).", 0)
+FIELD(SEGS, seg, STR, "VDOWritePolicy", list, 0, vdo_write_policy, vdo_write_policy, "Specified write policy (vdopool).", 0)
+FIELD(SEGS, seg, SIZ, "VDOHeaderSize", list, 0, vdo_header_size, vdo_header_size, "Header size at front of vdopool.", 0)
+
/*
* End of SEGS type fields
*/
diff --git a/lib/report/properties.c b/lib/report/properties.c
index 74f13c8..25e263f 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -279,6 +279,55 @@ GET_PV_NUM_PROPERTY_FN(pv_ba_size, SECTOR_SIZE * pv->ba_size)
#define _cache_write_misses_set prop_not_implemented_set
#define _cache_write_misses_get prop_not_implemented_get
+#define _vdo_operating_mode_set prop_not_implemented_set
+#define _vdo_operating_mode_get prop_not_implemented_get
+#define _vdo_compression_state_set prop_not_implemented_set
+#define _vdo_compression_state_get prop_not_implemented_get
+#define _vdo_index_state_set prop_not_implemented_set
+#define _vdo_index_state_get prop_not_implemented_get
+#define _vdo_used_size_set prop_not_implemented_set
+#define _vdo_used_size_get prop_not_implemented_get
+#define _vdo_saving_percent_set prop_not_implemented_set
+#define _vdo_saving_percent_get prop_not_implemented_get
+#define _vdo_compression_set prop_not_implemented_set
+#define _vdo_compression_get prop_not_implemented_get
+#define _vdo_deduplication_set prop_not_implemented_set
+#define _vdo_deduplication_get prop_not_implemented_get
+#define _vdo_use_metadata_hints_set prop_not_implemented_set
+#define _vdo_use_metadata_hints_get prop_not_implemented_get
+#define _vdo_minimum_io_size_set prop_not_implemented_set
+#define _vdo_minimum_io_size_get prop_not_implemented_get
+#define _vdo_block_map_cache_size_set prop_not_implemented_set
+#define _vdo_block_map_cache_size_get prop_not_implemented_get
+#define _vdo_block_map_era_length_set prop_not_implemented_set
+#define _vdo_block_map_era_length_get prop_not_implemented_get
+#define _vdo_use_sparse_index_set prop_not_implemented_set
+#define _vdo_use_sparse_index_get prop_not_implemented_get
+#define _vdo_index_memory_size_set prop_not_implemented_set
+#define _vdo_index_memory_size_get prop_not_implemented_get
+#define _vdo_slab_size_set prop_not_implemented_set
+#define _vdo_slab_size_get prop_not_implemented_get
+#define _vdo_ack_threads_set prop_not_implemented_set
+#define _vdo_ack_threads_get prop_not_implemented_get
+#define _vdo_bio_threads_set prop_not_implemented_set
+#define _vdo_bio_threads_get prop_not_implemented_get
+#define _vdo_bio_rotation_set prop_not_implemented_set
+#define _vdo_bio_rotation_get prop_not_implemented_get
+#define _vdo_cpu_threads_set prop_not_implemented_set
+#define _vdo_cpu_threads_get prop_not_implemented_get
+#define _vdo_hash_zone_threads_set prop_not_implemented_set
+#define _vdo_hash_zone_threads_get prop_not_implemented_get
+#define _vdo_logical_threads_set prop_not_implemented_set
+#define _vdo_logical_threads_get prop_not_implemented_get
+#define _vdo_physical_threads_set prop_not_implemented_set
+#define _vdo_physical_threads_get prop_not_implemented_get
+#define _vdo_max_discard_set prop_not_implemented_set
+#define _vdo_max_discard_get prop_not_implemented_get
+#define _vdo_write_policy_set prop_not_implemented_set
+#define _vdo_write_policy_get prop_not_implemented_get
+#define _vdo_header_size_set prop_not_implemented_set
+#define _vdo_header_size_get prop_not_implemented_get
+
/* LV */
GET_LV_STR_PROPERTY_FN(lv_uuid, lv_uuid_dup(lv->vg->vgmem, lv))
#define _lv_uuid_set prop_not_implemented_set
diff --git a/lib/report/report.c b/lib/report/report.c
index 730b0af..70ee514 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2014 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2019 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@@ -2407,6 +2407,74 @@ static int _lvkreadahead_disp(struct dm_report *rh, struct dm_pool *mem,
return _size32_disp(rh, mem, field, &lvdm->info.read_ahead, private);
}
+static int _vdo_operating_mode_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ const struct lv_with_info_and_seg_status *lvdm = (const struct lv_with_info_and_seg_status *) data;
+
+ if ((lv_is_vdo_pool(lvdm->lv) || lv_is_vdo(lvdm->lv)) &&
+ (lvdm->seg_status.type == SEG_STATUS_VDO_POOL))
+ return _field_string(rh, field, get_vdo_operating_mode_name(lvdm->seg_status.vdo_pool.vdo->operating_mode));
+
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64));
+}
+
+static int _vdo_compression_state_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ const struct lv_with_info_and_seg_status *lvdm = (const struct lv_with_info_and_seg_status *) data;
+
+ if ((lv_is_vdo_pool(lvdm->lv) || lv_is_vdo(lvdm->lv)) &&
+ (lvdm->seg_status.type == SEG_STATUS_VDO_POOL))
+ return _field_string(rh, field, get_vdo_compression_state_name(lvdm->seg_status.vdo_pool.vdo->compression_state));
+
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64));
+}
+
+static int _vdo_index_state_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ const struct lv_with_info_and_seg_status *lvdm = (const struct lv_with_info_and_seg_status *) data;
+
+ if ((lv_is_vdo_pool(lvdm->lv) || lv_is_vdo(lvdm->lv)) &&
+ (lvdm->seg_status.type == SEG_STATUS_VDO_POOL))
+ return _field_string(rh, field, get_vdo_index_state_name(lvdm->seg_status.vdo_pool.vdo->index_state));
+
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64));
+}
+
+static int _vdo_used_size_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ uint64_t size;
+ const struct lv_with_info_and_seg_status *lvdm = (const struct lv_with_info_and_seg_status *) data;
+
+ if ((lv_is_vdo_pool(lvdm->lv) || lv_is_vdo(lvdm->lv)) &&
+ (lvdm->seg_status.type == SEG_STATUS_VDO_POOL)) {
+ size = lvdm->seg_status.vdo_pool.vdo->used_blocks * DM_VDO_BLOCK_SIZE;
+ return _size64_disp(rh, mem, field, &size, private);
+ }
+
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64));
+}
+
+static int _vdo_saving_percent_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ const struct lv_with_info_and_seg_status *lvdm = (const struct lv_with_info_and_seg_status *) data;
+
+ if ((lv_is_vdo_pool(lvdm->lv) || lv_is_vdo(lvdm->lv)) &&
+ (lvdm->seg_status.type == SEG_STATUS_VDO_POOL))
+ return dm_report_field_percent(rh, field, &lvdm->seg_status.vdo_pool.saving);
+
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64));
+}
+
static int _vgsize_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private)
@@ -3807,6 +3875,180 @@ GENERATE_CACHE_STATUS_DISP_FN(read_misses)
GENERATE_CACHE_STATUS_DISP_FN(write_hits)
GENERATE_CACHE_STATUS_DISP_FN(write_misses)
+
+/*
+ * Macro to generate '_vdo_<vdo_field_name>_disp' reporting function.
+ * The 'vdo_field_name' is field name from struct lv_vdo_status.
+ */
+#define GENERATE_VDO_FIELD_DISP_FN(vdo_field_name) \
+static int _vdo_ ## vdo_field_name ## _disp (struct dm_report *rh, struct dm_pool *mem, \
+ struct dm_report_field *field, \
+ const void *data, void *private) \
+{ \
+ const struct lv_segment *seg = (const struct lv_segment *) data; \
+\
+ if (seg_is_vdo(seg)) \
+ seg = first_seg(seg_lv(seg, 0)); \
+\
+ if (!seg_is_vdo_pool(seg)) \
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64)); \
+\
+ return dm_report_field_uint32(rh, field, &seg->vdo_params.vdo_field_name); \
+}
+
+GENERATE_VDO_FIELD_DISP_FN(block_map_era_length)
+GENERATE_VDO_FIELD_DISP_FN(ack_threads)
+GENERATE_VDO_FIELD_DISP_FN(bio_threads)
+GENERATE_VDO_FIELD_DISP_FN(bio_rotation)
+GENERATE_VDO_FIELD_DISP_FN(cpu_threads)
+GENERATE_VDO_FIELD_DISP_FN(hash_zone_threads)
+GENERATE_VDO_FIELD_DISP_FN(logical_threads)
+GENERATE_VDO_FIELD_DISP_FN(physical_threads)
+GENERATE_VDO_FIELD_DISP_FN(max_discard)
+
+/*
+ * Macro to generate '_vdo_<vdo_field_name>_disp' reporting function.
+ * The 'vdo_field_name' is field name from struct lv_vdo_status.
+ */
+#define GENERATE_VDO_FIELDSZMB_DISP_FN(vdo_field_name) \
+static int _vdo_ ## vdo_field_name ## _disp (struct dm_report *rh, struct dm_pool *mem, \
+ struct dm_report_field *field, \
+ const void *data, void *private) \
+{ \
+ uint64_t size; \
+ const struct lv_segment *seg = (const struct lv_segment *) data; \
+\
+ if (seg_is_vdo(seg)) \
+ seg = first_seg(seg_lv(seg, 0)); \
+\
+ if (!seg_is_vdo_pool(seg)) \
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64)); \
+\
+ size = seg->vdo_params.vdo_field_name ## _mb * (1024 * 1024 >> SECTOR_SHIFT); \
+\
+ return _size64_disp(rh, mem, field, &size, private);\
+}
+
+GENERATE_VDO_FIELDSZMB_DISP_FN(block_map_cache_size)
+GENERATE_VDO_FIELDSZMB_DISP_FN(index_memory_size)
+GENERATE_VDO_FIELDSZMB_DISP_FN(slab_size)
+
+static int _vdo_compression_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ const struct lv_segment *seg = (const struct lv_segment *) data; \
+
+ if (seg_is_vdo(seg))
+ seg = first_seg(seg_lv(seg, 0));
+
+ if (seg_is_vdo_pool(seg))
+ return _binary_disp(rh, mem, field, seg->vdo_params.use_compression,
+ GET_FIRST_RESERVED_NAME(vdo_compression_y), private);
+
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64)); \
+}
+
+static int _vdo_deduplication_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ const struct lv_segment *seg = (const struct lv_segment *) data; \
+
+ if (seg_is_vdo(seg))
+ seg = first_seg(seg_lv(seg, 0));
+
+ if (seg_is_vdo_pool(seg))
+ return _binary_disp(rh, mem, field, seg->vdo_params.use_deduplication,
+ GET_FIRST_RESERVED_NAME(vdo_deduplication_y), private);
+
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64)); \
+}
+
+static int _vdo_use_metadata_hints_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ const struct lv_segment *seg = (const struct lv_segment *) data;
+
+ if (seg_is_vdo(seg))
+ seg = first_seg(seg_lv(seg, 0));
+
+ if (seg_is_vdo_pool(seg))
+ return _binary_disp(rh, mem, field, seg->vdo_params.use_metadata_hints,
+ GET_FIRST_RESERVED_NAME(vdo_use_metadata_hints_y),
+ private);
+
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64));
+}
+
+static int _vdo_use_sparse_index_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ const struct lv_segment *seg = (const struct lv_segment *) data;
+
+ if (seg_is_vdo(seg))
+ seg = first_seg(seg_lv(seg, 0));
+
+ if (seg_is_vdo_pool(seg))
+ return _binary_disp(rh, mem, field, seg->vdo_params.use_sparse_index,
+ GET_FIRST_RESERVED_NAME(vdo_use_sparse_index_y),
+ private);
+
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64));
+}
+
+static int _vdo_minimum_io_size_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
+{
+ const struct lv_segment *seg = (const struct lv_segment *) data;
+
+ if (seg_is_vdo(seg))
+ seg = first_seg(seg_lv(seg, 0));
+
+ if (seg_is_vdo_pool(seg))
+ return _size32_disp(rh, mem, field, &seg->vdo_params.minimum_io_size, private);
+
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64));
+}
+
+static int _vdo_header_size_disp(struct dm_report *rh,
+ struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data,
+ void *private)
+{
+ const struct lv_segment *seg = (const struct lv_segment *) data;
+
+ if (seg_is_vdo(seg))
+ seg = first_seg(seg_lv(seg, 0));
+
+ if (seg_is_vdo_pool(seg))
+ return _size32_disp(rh, mem, field, &seg->vdo_pool_header_size, private);
+
+ return _field_set_value(field, "", &GET_TYPE_RESERVED_VALUE(num_undef_64));
+}
+
+static int _vdo_write_policy_disp(struct dm_report *rh,
+ struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data,
+ void *private)
+{
+ const struct lv_segment *seg = (const struct lv_segment *) data;
+
+ if (seg_is_vdo(seg))
+ seg = first_seg(seg_lv(seg, 0));
+
+ if (seg_is_vdo_pool(seg))
+ return _field_string(rh, field, get_vdo_write_policy_name(seg->vdo_params.write_policy));
+
+ return _field_set_value(field, GET_FIRST_RESERVED_NAME(vdo_write_policy_undef),
+ GET_FIELD_RESERVED_VALUE(vdo_write_policy_undef));
+}
+
/* Report object types */
/* necessary for displaying something for PVs not belonging to VG */
diff --git a/lib/report/values.h b/lib/report/values.h
index 96729ef..9b98c22 100644
--- a/lib/report/values.h
+++ b/lib/report/values.h
@@ -84,6 +84,10 @@ FIELD_RESERVED_BINARY_VALUE(lv_device_open, lv_device_open, "", "open")
FIELD_RESERVED_BINARY_VALUE(lv_skip_activation, lv_skip_activation, "", "skip activation", "skip")
FIELD_RESERVED_BINARY_VALUE(zero, zero, "", "zero")
FIELD_RESERVED_BINARY_VALUE(lv_check_needed, lv_check_needed, "", "check needed", "needed")
+FIELD_RESERVED_BINARY_VALUE(vdo_compression, vdo_compression, "", "enabled" )
+FIELD_RESERVED_BINARY_VALUE(vdo_deduplication, vdo_deduplication, "", "enabled" )
+FIELD_RESERVED_BINARY_VALUE(vdo_use_metadata_hints, vdo_use_metadata_hints, "", "enabled" )
+FIELD_RESERVED_BINARY_VALUE(vdo_use_sparse_index, vdo_use_sparse_index, "", "enabled" )
FIELD_RESERVED_VALUE(NAMED, lv_permissions, lv_permissions_rw, "", "writeable", "writeable", "rw", "read-write")
FIELD_RESERVED_VALUE(NAMED, lv_permissions, lv_permissions_r, "", "read-only", "read-only", "r", "ro")
FIELD_RESERVED_VALUE(NAMED, lv_permissions, lv_permissions_r_override, "", "read-only-override", "read-only-override", "ro-override", "r-override", "R")
@@ -99,6 +103,7 @@ FIELD_RESERVED_VALUE(NOFLAG, cache_policy, cache_policy_undef, "", "", "", "unde
FIELD_RESERVED_VALUE(NOFLAG, seg_monitor, seg_monitor_undef, "", "", "", "undefined")
FIELD_RESERVED_VALUE(NOFLAG, lv_health_status, health_undef, "", "", "", "undefined")
FIELD_RESERVED_VALUE(NOFLAG, kernel_discards, seg_kernel_discards_undef, "", "", "", "undefined")
+FIELD_RESERVED_VALUE(NOFLAG, vdo_write_policy, vdo_write_policy_undef, "", "", "", "undefined")
/* TODO the following 2 need STR_LIST support for reserved values
FIELD_RESERVED_VALUE(cache_settings, cache_settings_default, "", "default", "default")
FIELD_RESERVED_VALUE(cache_settings, cache_settings_undef, "", "undefined", "undefined") */
4 years, 7 months
master - vdo: remember configure VDO write policy in metadata
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=862aa06e5eb28c0a9a1...
Commit: 862aa06e5eb28c0a9a163f109bdaeba9729243bc
Parent: 7ca9be034f451bc9a87b36dce4f9979db5a67efd
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 4 15:09:11 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 4 17:31:55 2019 +0200
vdo: remember configure VDO write policy in metadata
Store write_policy in vdopool metadata.
In case it's not present 'auto' is selected.
---
lib/vdo/vdo.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/lib/vdo/vdo.c b/lib/vdo/vdo.c
index b4cb578..01d95f7 100644
--- a/lib/vdo/vdo.c
+++ b/lib/vdo/vdo.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@@ -189,6 +189,7 @@ static void _vdo_pool_display(const struct lv_segment *seg)
log_print(" # Logical threads\t%u", (unsigned) vtp->logical_threads);
log_print(" # Physical threads\t%u", (unsigned) vtp->physical_threads);
log_print(" Max discard\t%u", (unsigned) vtp->max_discard);
+ log_print(" Write policy\t%s", get_vdo_write_policy_name(vtp->write_policy));
}
/* reused as _vdo_text_import_area_count */
@@ -280,6 +281,12 @@ static int _vdo_pool_text_import(struct lv_segment *seg,
if (!dm_config_get_uint32(n, "physical_threads", &vtp->physical_threads))
return _bad_field("physical_threads");
+ if (dm_config_has_node(n, "write_policy")) {
+ if (!(str = dm_config_find_str(n, "write_policy", NULL)) ||
+ !set_vdo_write_policy(&vtp->write_policy, str))
+ return _bad_field("write_policy");
+ } else
+ vtp->write_policy = DM_VDO_WRITE_POLICY_AUTO;
if (!set_lv_segment_area_lv(seg, 0, data_lv, 0, LV_VDO_POOL_DATA))
return_0;
@@ -334,6 +341,9 @@ static int _vdo_pool_text_export(const struct lv_segment *seg, struct formatter
outf(f, "logical_threads = %u", (unsigned) vtp->logical_threads);
outf(f, "physical_threads = %u", (unsigned) vtp->physical_threads);
+ if (vtp->write_policy != DM_VDO_WRITE_POLICY_AUTO)
+ outf(f, "write_policy = %s", get_vdo_write_policy_name(vtp->write_policy));
+
return 1;
}
4 years, 7 months
master - vdo: field update
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7ca9be034f451bc9a87...
Commit: 7ca9be034f451bc9a87b36dce4f9979db5a67efd
Parent: cf8aee096f2064fb8d8421f73807ad98746bc7c6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Sep 30 15:29:01 2019 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 4 17:31:55 2019 +0200
vdo: field update
---
lib/report/columns.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/report/columns.h b/lib/report/columns.h
index 827a157..6f0f638 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -90,12 +90,12 @@ FIELD(LVS, lv, STR, "Convert", lvid, 0, convertlv, convert_lv, "For lvconvert, N
FIELD(LVS, lv, STR, "Convert UUID", lvid, 38, convertlvuuid, convert_lv_uuid, "For lvconvert, UUID of temporary LV created by lvconvert.", 0)
FIELD(LVS, lv, STR, "Log", lvid, 0, loglv, mirror_log, "For mirrors, the LV holding the synchronisation log.", 0)
FIELD(LVS, lv, STR, "Log UUID", lvid, 38, loglvuuid, mirror_log_uuid, "For mirrors, the UUID of the LV holding the synchronisation log.", 0)
-FIELD(LVS, lv, STR, "Data", lvid, 0, datalv, data_lv, "For thin and cache pools, the LV holding the associated data.", 0)
-FIELD(LVS, lv, STR, "Data UUID", lvid, 38, datalvuuid, data_lv_uuid, "For thin and cache pools, the UUID of the LV holding the associated data.", 0)
-FIELD(LVS, lv, STR, "Meta", lvid, 0, metadatalv, metadata_lv, "For thin and cache pools, the LV holding the associated metadata.", 0)
-FIELD(LVS, lv, STR, "Meta UUID", lvid, 38, metadatalvuuid, metadata_lv_uuid, "For thin and cache pools, the UUID of the LV holding the associated metadata.", 0)
-FIELD(LVS, lv, STR, "Pool", lvid, 0, poollv, pool_lv, "For thin volumes, the thin pool LV for this volume.", 0)
-FIELD(LVS, lv, STR, "Pool UUID", lvid, 38, poollvuuid, pool_lv_uuid, "For thin volumes, the UUID of the thin pool LV for this volume.", 0)
+FIELD(LVS, lv, STR, "Data", lvid, 0, datalv, data_lv, "For cache/thin/vdo pools, the LV holding the associated data.", 0)
+FIELD(LVS, lv, STR, "Data UUID", lvid, 38, datalvuuid, data_lv_uuid, "For cache/thin/vdo pools, the UUID of the LV holding the associated data.", 0)
+FIELD(LVS, lv, STR, "Meta", lvid, 0, metadatalv, metadata_lv, "For cache/thin pools, the LV holding the associated metadata.", 0)
+FIELD(LVS, lv, STR, "Meta UUID", lvid, 38, metadatalvuuid, metadata_lv_uuid, "For cache/thin pools, the UUID of the LV holding the associated metadata.", 0)
+FIELD(LVS, lv, STR, "Pool", lvid, 0, poollv, pool_lv, "For cache/thin/vdo volumes, the cache/thin/vdo pool LV for this volume.", 0)
+FIELD(LVS, lv, STR, "Pool UUID", lvid, 38, poollvuuid, pool_lv_uuid, "For cache/thin/vdo volumes, the UUID of the cache/thin/vdo pool LV for this volume.", 0)
FIELD(LVS, lv, STR_LIST, "LV Tags", tags, 0, tags, lv_tags, "Tags, if any.", 0)
FIELD(LVS, lv, STR, "LProfile", lvid, 0, lvprofile, lv_profile, "Configuration profile attached to this LV.", 0)
FIELD(LVS, lv, STR, "LLockArgs", lvid, 0, lvlockargs, lv_lockargs, "Lock args of the LV used by lvmlockd.", 0)
4 years, 7 months