main - tests: aux always shift emulated devices by 1MiB
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1880b573f3b69deb561...
Commit: 1880b573f3b69deb561251dea003b5be7ff59ab3
Parent: 8e7690b7980ad3bc6e7c38d6e2028f885751c355
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 18 13:32:48 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 18:57:45 2021 +0100
tests: aux always shift emulated devices by 1MiB
Always shift created virtual PVs on backing device by 1MiB
and leave 1MiB free space at the end of device.
This way the system doesn't see same PV headers at multiple devices.
---
test/lib/aux.sh | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 53975301a..8c727e8c6 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -696,7 +696,7 @@ prepare_scsi_debug_dev() {
# NOTE: it will _never_ make sense to pass num_tgts param;
# last param wins.. so num_tgts=1 is imposed
touch SCSI_DEBUG_DEV
- modprobe scsi_debug dev_size_mb="$DEV_SIZE" "$@" num_tgts=1 || skip
+ modprobe scsi_debug dev_size_mb="$(( DEV_SIZE + 2 ))" "$@" num_tgts=1 || skip
for i in {1..20} ; do
sleep .1 # allow for async Linux SCSI device registration
@@ -874,7 +874,7 @@ prepare_devs() {
local n=${1:-3}
local devsize=${2:-34}
local pvname=${3:-pv}
- local shift=0
+ local header_shift=1 # shift header from begin & end of device by 1MiB
# sanlock requires more space for the internal sanlock lv
# This could probably be lower, but what are the units?
@@ -883,9 +883,7 @@ prepare_devs() {
fi
touch DEVICES
- prepare_backing_dev $(( n * devsize ))
- # shift start of PV devices on /dev/loopXX by 1M
- not diff LOOP BACKING_DEV >/dev/null 2>&1 || shift=2048
+ prepare_backing_dev $(( n * devsize + 2 * header_shift ))
blkdiscard "$BACKING_DEV" 2>/dev/null || true
echo -n "## preparing $n devices..."
@@ -898,7 +896,7 @@ prepare_devs() {
local dev="$DM_DEV_DIR/mapper/$name"
DEVICES[$count]=$dev
count=$(( count + 1 ))
- echo 0 $size linear "$BACKING_DEV" $(( ( i - 1 ) * size + shift )) > "$name.table"
+ echo 0 $size linear "$BACKING_DEV" $(( ( i - 1 ) * size + ( header_shift * 2048 ) )) > "$name.table"
dmsetup create -u "TEST-$name" "$name" "$name.table" || touch CREATE_FAILED &
test -f CREATE_FAILED && break;
done
3 years, 1 month
main - thinpool: support lvconvert without zeroing
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8e7690b7980ad3bc6e7...
Commit: 8e7690b7980ad3bc6e7c38d6e2028f885751c355
Parent: 1c3774c7a834bd0ad0dcf356f694e123d8955d9d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 17 19:09:58 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 18:57:45 2021 +0100
thinpool: support lvconvert without zeroing
Since lvm does support external users of thin-pool when thin devices
are managed outside it can be useful to support conversion to
thin pool from data and metadata LV without zeroing.
TransactionID will be 0 in lvm2 metadata.
lvconvert -Zn --thinpool vg/data --poolmetadata vg/meta
---
tools/lvconvert.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index b50074294..e8a38f33c 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3086,8 +3086,8 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
/* Allow to have only thinpool active and restore it's active state. */
activate_pool = to_thinpool && lv_is_active(lv);
- /* Wipe metadata_lv by default, but allow skipping this for cache pools. */
- zero_metadata = (to_cachepool) ? arg_int_value(cmd, zero_ARG, 1) : 1;
+ /* Wipe metadata_lv by default, but allow skipping on user's request. */
+ zero_metadata = arg_int_value(cmd, zero_ARG, 1);
/* An existing LV needs to have its lock freed once it becomes a data LV. */
if (vg_is_shared(vg) && lv->lock_args) {
@@ -3250,8 +3250,8 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
if (zero_metadata)
log_warn("THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)");
- else if (to_cachepool)
- log_warn("WARNING: Using mismatched cache pool metadata MAY DESTROY YOUR DATA!");
+ else
+ log_warn("WARNING: Using mismatched pool metadata MAY DESTROY YOUR DATA!");
if (!arg_count(cmd, yes_ARG) &&
yes_no_prompt("Do you really want to convert %s? [y/n]: ",
3 years, 1 month
main - pool: allow data on zero and error segtypes
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1c3774c7a834bd0ad0d...
Commit: 1c3774c7a834bd0ad0dcf356f694e123d8955d9d
Parent: 7a9efc5fae713a09cc1d1238a19a1cac555fb364
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 17 18:26:08 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 18:57:45 2021 +0100
pool: allow data on zero and error segtypes
Renables usage of --type zero and --type error LVs to serve as
backend for _tdata device. Clearly not very useful in practice,
as it can't store any real data, but usable for some testing
and some sort of perfomance checking.
lvcreate --type zero -L1T -n pool vg
lvconvert --thinpool vg/pool
Will create a thin-pool with zero device backend.
---
tools/command-lines.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/command-lines.in b/tools/command-lines.in
index 621731174..528811f52 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -435,7 +435,7 @@ FLAGS: SECONDARY_SYNTAX
# lvconvert utilities for creating/maintaining thin and cache objects.
# Create a new command set for these and migrate them out of lvconvert?
-lvconvert --type thin --thinpool LV LV_linear_striped_raid_cache_thin
+lvconvert --type thin --thinpool LV LV_linear_striped_raid_cache_thin_error_zero
OO: --thin, --originname LV_new, OO_LVCONVERT_POOL, OO_LVCONVERT
ID: lvconvert_to_thin_with_external
DESC: Convert LV to a thin LV, using the original LV as an external origin.
@@ -444,7 +444,7 @@ RULE: all not lv_is_locked lv_is_raid_with_integrity
RULE: --poolmetadata not --readahead --stripesize --stripes_long
# alternate form of lvconvert --type thin
-lvconvert --thin --thinpool LV LV_linear_striped_raid_cache_thin
+lvconvert --thin --thinpool LV LV_linear_striped_raid_cache_thin_error_zero
OO: --type thin, --originname LV_new, OO_LVCONVERT_POOL, OO_LVCONVERT
ID: lvconvert_to_thin_with_external
DESC: Convert LV to a thin LV, using the original LV as an external origin
@@ -517,7 +517,7 @@ RULE: all and lv_is_visible
---
-lvconvert --type thin-pool LV_linear_striped_raid_cache
+lvconvert --type thin-pool LV_linear_striped_raid_cache_error_zero
OO: --stripes_long Number, --stripesize SizeKB,
OO_LVCONVERT_THIN, OO_LVCONVERT_POOL, OO_LVCONVERT
OP: PV ...
@@ -593,7 +593,7 @@ RULE: all not lv_is_raid_with_integrity
# This command syntax is deprecated, and the primary forms
# of creating a pool or swapping metadata should be used.
-lvconvert --cachepool LV_linear_striped_raid_cachepool
+lvconvert --cachepool LV_linear_striped_raid_cachepool_error_zero
OO: --type cache-pool, OO_LVCONVERT_CACHE, OO_LVCONVERT_POOL, OO_LVCONVERT
OP: PV ...
ID: lvconvert_to_cachepool_or_swap_metadata
3 years, 1 month
main - lvresize: allow mixing striped with errors or zero
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7a9efc5fae713a09cc1...
Commit: 7a9efc5fae713a09cc1d1238a19a1cac555fb364
Parent: b35ef9d67cabd23f65e2ee2113af46bea095138c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 18 13:19:45 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 18:56:49 2021 +0100
lvresize: allow mixing striped with errors or zero
Enabled extension/mixing of stripes/linears, error and zero
segtype LVs with stripes/linear, error and zero segtypes.
It is not very useful in practice, as the user cannot store any real
data on error or zero segtypes, but it may get some uses in
some scenarios where i.e. some portion of the device should not be
readable. Mixing of types happens on 'extent_size' level:
lvcreate -L1 -n lv vg
lvextend --type error -L+1 vg/lv
lvextend --type zero -L+1 vg/lv
lvextend --type linear -L+1 vg/lv
lvextend --type striped -L+1 vg/lv
lvs -o+segtype,seg_size vg
Note: when the type is not specified, the last segment type is
automatically selected.
It's also a small 'can of worms' since we can't tell LVs if
the LV is linear/error/zero or their mixtures. So the meaning behind
them may need some updates.
We already have this types of LV created i.e by:
vgreduce --removemissing --force
where missing LV segments have been replaced by either
error or zero segtype (lvm.conf).
TODO: it might be worth adding a message while such device is activated.
---
lib/metadata/lv_manip.c | 26 +++++++++++++++++++-------
tools/lvresize.c | 17 +++++++++++++++--
2 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 803f76052..81346bd1a 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5456,15 +5456,27 @@ static int _lvresize_adjust_extents(struct logical_volume *lv,
seg_last = last_seg(lv);
- /* FIXME Support LVs with mixed segment types */
- if (lp->segtype && (lp->segtype != seg_last->segtype)) {
- log_error("VolumeType does not match (%s).", lp->segtype->name);
- return 0;
+ if (!lp->segtype)
+ /* Use segment type of last segment */
+ lp->segtype = seg_last->segtype;
+ else if (lp->segtype != seg_last->segtype) {
+ /* Support newseg error or zero with lastseg striped
+ * and newseg striped with lastseg error or zero */
+ if ((segtype_is_error(lp->segtype) || segtype_is_zero(lp->segtype) ||
+ segtype_is_striped(lp->segtype)) &&
+ (segtype_is_striped(seg_last->segtype) ||
+ segtype_is_error(seg_last->segtype) || segtype_is_zero(seg_last->segtype))) {
+ if (!lp->stripes)
+ lp->stripes = 1;
+ } else {
+ log_error("VolumeType does not match (%s).", lp->segtype->name);
+ return 0;
+ }
+ /* FIXME Support more LVs with mixed segment types */
+ log_print_unless_silent("Logical volume %s is using mixing segment types %s and %s.",
+ display_lvname(lv), seg_last->segtype->name, lp->segtype->name);
}
- /* Use segment type of last segment */
- lp->segtype = seg_last->segtype;
-
/* For virtual devices, just pretend the physical size matches. */
existing_physical_extents = saved_existing_physical_extents = _lv_pe_count(lv);
if (!existing_physical_extents) {
diff --git a/tools/lvresize.c b/tools/lvresize.c
index a3c17a744..f39f03a40 100644
--- a/tools/lvresize.c
+++ b/tools/lvresize.c
@@ -20,9 +20,17 @@ static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv,
{
const char *cmd_name = command_name(cmd);
const char *type_str = arg_str_value(cmd, type_ARG, NULL);
+ int only_linear = 0;
- if (type_str && !(lp->segtype = get_segtype_from_string(cmd, type_str)))
- return_0;
+ if (type_str) {
+ if (!strcmp(type_str, "linear")) {
+ type_str = "striped";
+ only_linear = 1; /* User requested linear only target */
+ }
+
+ if (!(lp->segtype = get_segtype_from_string(cmd, type_str)))
+ return_0;
+ }
if (!strcmp(cmd_name, "lvreduce"))
lp->resize = LV_REDUCE;
@@ -137,6 +145,11 @@ static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv,
return 0;
}
+ if (only_linear && lp->stripes > 1) {
+ log_error("Cannot use stripes with linear type.");
+ return 0;
+ }
+
if ((lp->stripe_size = arg_uint64_value(cmd, stripesize_ARG, 0)) &&
(arg_sign_value(cmd, stripesize_ARG, SIGN_NONE) == SIGN_MINUS)) {
log_error("Stripesize may not be negative.");
3 years, 1 month
main - segtypes: macros for error and zero segtypes
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b35ef9d67cabd23f65e...
Commit: b35ef9d67cabd23f65e2ee2113af46bea095138c
Parent: 22554c3ff0807f62f8fa71faab153958c475028b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 18 13:13:38 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 18:34:57 2021 +0100
segtypes: macros for error and zero segtypes
---
lib/metadata/segtype.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/metadata/segtype.h b/lib/metadata/segtype.h
index 676f37e3c..d7cfc2b72 100644
--- a/lib/metadata/segtype.h
+++ b/lib/metadata/segtype.h
@@ -115,6 +115,8 @@ struct dev_manager;
#define SEG_TYPE_NAME_RAID6_N_6 "raid6_n_6"
#define segtype_is_linear(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_LINEAR))
+#define segtype_is_error(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_ERROR))
+#define segtype_is_zero(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_ZERO))
#define segtype_is_striped_target(segtype) ((segtype)->flags & SEG_STRIPED_TARGET ? 1 : 0)
#define segtype_is_cache(segtype) ((segtype)->flags & SEG_CACHE ? 1 : 0)
#define segtype_is_cache_pool(segtype) ((segtype)->flags & SEG_CACHE_POOL ? 1 : 0)
3 years, 1 month
main - lvremove: extra code for handling thinpool data
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=22554c3ff0807f62f8f...
Commit: 22554c3ff0807f62f8fa71faab153958c475028b
Parent: 5a73399b73305786b61c8dcc78a76d4319608561
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 18 13:15:44 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 18:34:57 2021 +0100
lvremove: extra code for handling thinpool data
Add some extra code to handle differently sized thin-pool
from thin-pool data volume.
ATM this can't really happen, but once we start to use multiple
commits while resizing stacked LV, we may actually get into
the position, where data LV has been already resized,
but thin-pool stayed with old size.
But for now - report difference as internal error.
---
lib/metadata/lv_manip.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 24a2816ef..803f76052 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -1605,6 +1605,21 @@ static int _lv_reduce(struct logical_volume *lv, uint32_t extents, int delete)
return_0;
}
+ if (seg_is_thin_pool(seg)) {
+ /* For some segtypes the size may differ between the segment size and its layered LV
+ * i.e. thin-pool and tdata.
+ *
+ * This can get useful, when we will support multiple commits
+ * while resizing a stacked LV.
+ */
+ if (seg->len != seg_lv(seg, 0)->le_count) {
+ seg->len = seg_lv(seg, 0)->le_count;
+ /* FIXME: ATM capture as error as it should not happen. */
+ log_debug(INTERNAL_ERROR "Pool size mismatched data size for %s",
+ display_lvname(seg->lv));
+ }
+ }
+
dm_list_del(&seg->list);
reduction = seg->len;
} else
3 years, 1 month
main - lvresize: support resize of stacked virtual LV
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5a73399b73305786b61...
Commit: 5a73399b73305786b61c8dcc78a76d4319608561
Parent: adc238062d13949cbf3a0b20abf310ee3f132e7e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 18 13:14:13 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 18:34:57 2021 +0100
lvresize: support resize of stacked virtual LV
Update the LV stack with the size also for virtual LVs.
---
lib/metadata/lv_manip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 3fff66b18..24a2816ef 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -3554,8 +3554,8 @@ int lv_add_virtual_segment(struct logical_volume *lv, uint64_t status,
dm_list_add(&lv->segments, &seg->list);
}
- lv->le_count += extents;
- lv->size += (uint64_t) extents *lv->vg->extent_size;
+ if (!_setup_lv_size(lv, lv->le_count + extents))
+ return_0;
return 1;
}
3 years, 1 month
main - dev_manager: skip also zero targets
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=adc238062d13949cbf3...
Commit: adc238062d13949cbf3a0b20abf310ee3f132e7e
Parent: a9b4acd511beb4d5ba8d0175ad1fb56927d92c03
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 18 17:17:21 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 18:34:57 2021 +0100
dev_manager: skip also zero targets
Devices made only from 'error' target cannot be used,
but if the device is also combined from 'zero' target
the same rule can be applied as such device cannot be used.
---
lib/activate/dev_manager.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 98917dc38..172a6bab1 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -630,7 +630,7 @@ int device_is_usable(struct device *dev, struct dev_usable_check_params check, i
char *params, *vgname, *lvname, *layer;
char vg_name[NAME_LEN];
void *next = NULL;
- int only_error_target = 1;
+ int only_error_or_zero_target = 1;
int r = 0;
if (!(dmt = _setup_task_run(DM_DEVICE_STATUS, &info, NULL, NULL, NULL,
@@ -766,13 +766,15 @@ int device_is_usable(struct device *dev, struct dev_usable_check_params check, i
goto out;
}
- if (strcmp(target_type, TARGET_NAME_ERROR))
- only_error_target = 0;
+ if (only_error_or_zero_target &&
+ strcmp(target_type, TARGET_NAME_ERROR) &&
+ strcmp(target_type, TARGET_NAME_ZERO))
+ only_error_or_zero_target = 0;
} while (next);
- /* Skip devices consisting entirely of error targets. */
+ /* Skip devices consisting entirely of error or zero targets. */
/* FIXME Deal with device stacked above error targets? */
- if (check.check_error_target && only_error_target) {
+ if (check.check_error_target && only_error_or_zero_target) {
log_debug_activation("%s: Error device %s not usable.",
dev_name(dev), name);
goto out;
3 years, 1 month
main - dev_manager: add lv_raid_status
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a9b4acd511beb4d5ba8...
Commit: a9b4acd511beb4d5ba8d0175ad1fb56927d92c03
Parent: e5a600860c1b00cd4199eafe26dbc668f8f583ff
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 17 09:50:09 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 18:34:57 2021 +0100
dev_manager: add lv_raid_status
Just like with other segtype use this function to get whole
raid status info available per a single ioctl call.
Also it nicely simplifies read of percentage info about
in_sync portion of raid volume.
TODO: drop use of other calls then lv_raid_status call,
since all such calls could already use status - so it just
adds unnecessary duplication.
---
lib/activate/activate.c | 133 +++++++++++++++++++--------------------
lib/activate/activate.h | 1 +
lib/activate/dev_manager.c | 20 ++++--
lib/activate/dev_manager.h | 2 +-
lib/metadata/metadata-exported.h | 5 ++
5 files changed, 88 insertions(+), 73 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 08afd6f38..8151293c3 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -972,35 +972,28 @@ int lv_raid_percent(const struct logical_volume *lv, dm_percent_t *percent)
int lv_raid_data_offset(const struct logical_volume *lv, uint64_t *data_offset)
{
- int r;
- struct dev_manager *dm;
- struct dm_status_raid *status;
+ struct lv_status_raid *raid_status;
if (!lv_info(lv->vg->cmd, lv, 0, NULL, 0, 0))
return 0;
log_debug_activation("Checking raid data offset and dev sectors for LV %s/%s",
lv->vg->name, lv->name);
- if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
- return_0;
- if (!(r = dev_manager_raid_status(dm, lv, &status))) {
- dev_manager_destroy(dm);
- return_0;
- }
+ if (!lv_raid_status(lv, &raid_status))
+ return_0;
- *data_offset = status->data_offset;
+ *data_offset = raid_status->raid->data_offset;
- dev_manager_destroy(dm);
+ dm_pool_destroy(raid_status->mem);
- return r;
+ return 1;
}
int lv_raid_dev_health(const struct logical_volume *lv, char **dev_health)
{
- int r;
- struct dev_manager *dm;
- struct dm_status_raid *status;
+ int r = 1;
+ struct lv_status_raid *raid_status;
*dev_health = NULL;
@@ -1010,25 +1003,23 @@ int lv_raid_dev_health(const struct logical_volume *lv, char **dev_health)
log_debug_activation("Checking raid device health for LV %s.",
display_lvname(lv));
- if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
- return_0;
+ if (!lv_raid_status(lv, &raid_status))
+ return_0;
- if (!(r = dev_manager_raid_status(dm, lv, &status)) ||
- !(*dev_health = dm_pool_strdup(lv->vg->cmd->mem,
- status->dev_health))) {
- dev_manager_destroy(dm);
- return_0;
+ if (!(*dev_health = dm_pool_strdup(lv->vg->cmd->mem,
+ raid_status->raid->dev_health))) {
+ stack;
+ r = 0;
}
- dev_manager_destroy(dm);
+ dm_pool_destroy(raid_status->mem);
return r;
}
int lv_raid_dev_count(const struct logical_volume *lv, uint32_t *dev_cnt)
{
- struct dev_manager *dm;
- struct dm_status_raid *status;
+ struct lv_status_raid *raid_status;
*dev_cnt = 0;
@@ -1037,24 +1028,20 @@ int lv_raid_dev_count(const struct logical_volume *lv, uint32_t *dev_cnt)
log_debug_activation("Checking raid device count for LV %s/%s",
lv->vg->name, lv->name);
- if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
- return_0;
- if (!dev_manager_raid_status(dm, lv, &status)) {
- dev_manager_destroy(dm);
+ if (!lv_raid_status(lv, &raid_status))
return_0;
- }
- *dev_cnt = status->dev_count;
- dev_manager_destroy(dm);
+ *dev_cnt = raid_status->raid->dev_count;
+
+ dm_pool_destroy(raid_status->mem);
return 1;
}
int lv_raid_mismatch_count(const struct logical_volume *lv, uint64_t *cnt)
{
- struct dev_manager *dm;
- struct dm_status_raid *status;
+ struct lv_status_raid *raid_status;
*cnt = 0;
@@ -1064,25 +1051,20 @@ int lv_raid_mismatch_count(const struct logical_volume *lv, uint64_t *cnt)
log_debug_activation("Checking raid mismatch count for LV %s.",
display_lvname(lv));
- if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
+ if (!lv_raid_status(lv, &raid_status))
return_0;
- if (!dev_manager_raid_status(dm, lv, &status)) {
- dev_manager_destroy(dm);
- return_0;
- }
- *cnt = status->mismatch_count;
+ *cnt = raid_status->raid->mismatch_count;
- dev_manager_destroy(dm);
+ dm_pool_destroy(raid_status->mem);
return 1;
}
int lv_raid_sync_action(const struct logical_volume *lv, char **sync_action)
{
- struct dev_manager *dm;
- struct dm_status_raid *status;
- char *action;
+ struct lv_status_raid *raid_status;
+ int r = 1;
*sync_action = NULL;
@@ -1092,30 +1074,27 @@ int lv_raid_sync_action(const struct logical_volume *lv, char **sync_action)
log_debug_activation("Checking raid sync_action for LV %s.",
display_lvname(lv));
- if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
+ if (!lv_raid_status(lv, &raid_status))
return_0;
/* status->sync_action can be NULL if dm-raid version < 1.5.0 */
- if (!dev_manager_raid_status(dm, lv, &status) ||
- !status->sync_action ||
- !(action = dm_pool_strdup(lv->vg->cmd->mem,
- status->sync_action))) {
- dev_manager_destroy(dm);
- return_0;
+ if (!raid_status->raid->sync_action ||
+ !(*sync_action = dm_pool_strdup(lv->vg->cmd->mem,
+ raid_status->raid->sync_action))) {
+ stack;
+ r = 0;
}
- *sync_action = action;
-
- dev_manager_destroy(dm);
+ dm_pool_destroy(raid_status->mem);
- return 1;
+ return r;
}
int lv_raid_message(const struct logical_volume *lv, const char *msg)
{
+ struct lv_status_raid *raid_status;
+ struct dev_manager *dm = NULL;
int r = 0;
- struct dev_manager *dm;
- struct dm_status_raid *status;
if (!seg_is_raid(first_seg(lv))) {
/*
@@ -1140,16 +1119,10 @@ int lv_raid_message(const struct logical_volume *lv, const char *msg)
return 0;
}
- if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
+ if (!lv_raid_status(lv, &raid_status))
return_0;
- if (!(r = dev_manager_raid_status(dm, lv, &status))) {
- log_error("Failed to retrieve status of %s.",
- display_lvname(lv));
- goto out;
- }
-
- if (!status->sync_action) {
+ if (!raid_status->raid->sync_action) {
log_error("Kernel driver does not support this action: %s", msg);
goto out;
}
@@ -1171,19 +1144,43 @@ int lv_raid_message(const struct logical_volume *lv, const char *msg)
log_error("\"%s\" is not a supported sync operation.", msg);
goto out;
}
- if (strcmp(status->sync_action, "idle")) {
+ if (strcmp(raid_status->raid->sync_action, "idle")) {
log_error("%s state is currently \"%s\". Unable to switch to \"%s\".",
- display_lvname(lv), status->sync_action, msg);
+ display_lvname(lv), raid_status->raid->sync_action, msg);
goto out;
}
+ if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
+ return_0;
+
r = dev_manager_raid_message(dm, lv, msg);
out:
- dev_manager_destroy(dm);
+ if (dm)
+ dev_manager_destroy(dm);
+ dm_pool_destroy(raid_status->mem);
return r;
}
+int lv_raid_status(const struct logical_volume *lv, struct lv_status_raid **status)
+{
+ struct dev_manager *dm;
+ int exists;
+
+ if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
+ return_0;
+
+ if (!dev_manager_raid_status(dm, lv, status, &exists)) {
+ dev_manager_destroy(dm);
+ if (exists)
+ stack;
+ return 0;
+ }
+ /* User has to call dm_pool_destroy(status->mem)! */
+
+ return 1;
+}
+
int lv_writecache_message(const struct logical_volume *lv, const char *msg)
{
int r = 0;
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
index 4c9328a66..edd385aef 100644
--- a/lib/activate/activate.h
+++ b/lib/activate/activate.h
@@ -188,6 +188,7 @@ int lv_raid_dev_health(const struct logical_volume *lv, char **dev_health);
int lv_raid_mismatch_count(const struct logical_volume *lv, uint64_t *cnt);
int lv_raid_sync_action(const struct logical_volume *lv, char **sync_action);
int lv_raid_message(const struct logical_volume *lv, const char *msg);
+int lv_raid_status(const struct logical_volume *lv, struct lv_status_raid **status);
int lv_writecache_message(const struct logical_volume *lv, const char *msg);
int lv_cache_status(const struct logical_volume *cache_lv,
struct lv_status_cache **status);
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 40b9ef31d..98917dc38 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1437,7 +1437,7 @@ int dev_manager_mirror_percent(struct dev_manager *dm,
int dev_manager_raid_status(struct dev_manager *dm,
const struct logical_volume *lv,
- struct dm_status_raid **status)
+ struct lv_status_raid **status, int *exists)
{
int r = 0;
const char *dlid;
@@ -1447,6 +1447,11 @@ int dev_manager_raid_status(struct dev_manager *dm,
char *type = NULL;
char *params = NULL;
const char *layer = lv_layer(lv);
+ struct dm_status_raid *sr;
+
+ *exists = -1;
+ if (!(*status = dm_pool_zalloc(dm->mem, sizeof(struct lv_status_cache))))
+ return_0;
if (!(dlid = build_dm_uuid(dm->mem, lv, layer)))
return_0;
@@ -1454,8 +1459,11 @@ int dev_manager_raid_status(struct dev_manager *dm,
if (!(dmt = _setup_task_run(DM_DEVICE_STATUS, &info, NULL, dlid, 0, 0, 0, 0, 0, 0)))
return_0;
- if (!info.exists)
- goto_out;
+ if (!(*exists = info.exists))
+ goto out;
+
+ log_debug_activation("Checking raid status for volume %s.",
+ display_lvname(lv));
dm_get_next_target(dmt, NULL, &start, &length, &type, ¶ms);
@@ -1467,9 +1475,13 @@ int dev_manager_raid_status(struct dev_manager *dm,
/* FIXME Check there's only one target */
- if (!dm_get_status_raid(dm->mem, params, status))
+ if (!dm_get_status_raid(dm->mem, params, &sr))
goto_out;
+ (*status)->mem = dm->mem; /* User has to destroy this mem pool later */
+ (*status)->raid = sr;
+ (*status)->in_sync = dm_make_percent(sr->insync_regions, sr->total_regions);
+
r = 1;
out:
dm_task_destroy(dmt);
diff --git a/lib/activate/dev_manager.h b/lib/activate/dev_manager.h
index dcd08818d..27092f2b9 100644
--- a/lib/activate/dev_manager.h
+++ b/lib/activate/dev_manager.h
@@ -59,7 +59,7 @@ int dev_manager_mirror_percent(struct dev_manager *dm,
dm_percent_t *percent, uint32_t *event_nr);
int dev_manager_raid_status(struct dev_manager *dm,
const struct logical_volume *lv,
- struct dm_status_raid **status);
+ struct lv_status_raid **status, int *exists);
int dev_manager_raid_message(struct dev_manager *dm,
const struct logical_volume *lv,
const char *msg);
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 874088993..8ae067ebc 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -1239,6 +1239,11 @@ int collapse_mirrored_lv(struct logical_volume *lv);
int shift_mirror_images(struct lv_segment *mirrored_seg, unsigned mimage);
/* ++ metadata/raid_manip.c */
+struct lv_status_raid {
+ struct dm_pool *mem;
+ struct dm_status_raid *raid;
+ dm_percent_t in_sync;
+};
int lv_is_raid_with_tracking(const struct logical_volume *lv);
uint32_t lv_raid_image_count(const struct logical_volume *lv);
int lv_raid_change_image_count(struct logical_volume *lv,
3 years, 1 month
main - dev_manager: status check with info check included
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e5a600860c1b00cd419...
Commit: e5a600860c1b00cd4199eafe26dbc668f8f583ff
Parent: a60c8748eac2e6f047532b6d106492d120860608
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 17 11:20:23 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 18 18:34:57 2021 +0100
dev_manager: status check with info check included
Reduce ioctl count and avoid separate info check,
when we can get the same info from status ioctl.
When devmanager calls return 0, then the exists value 0
means the reason of failure is missing device in table.
In such case we avoid stack trace.
Swap the flush parameter for the vdo status function
to match thin pool status.
---
lib/activate/activate.c | 78 ++++++++++++++++-----------------------------
lib/activate/dev_manager.c | 79 +++++++++++++++++++++++++++-------------------
lib/activate/dev_manager.h | 13 ++++----
3 files changed, 80 insertions(+), 90 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 93ab30424..08afd6f38 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1216,6 +1216,7 @@ int lv_cache_status(const struct logical_volume *cache_lv,
{
struct dev_manager *dm;
struct lv_segment *cache_seg;
+ int exists;
if (lv_is_cache_pool(cache_lv)) {
if (dm_list_empty(&cache_lv->segs_using_this_lv) ||
@@ -1233,21 +1234,14 @@ int lv_cache_status(const struct logical_volume *cache_lv,
return 0;
}
- if (!lv_info(cache_lv->vg->cmd, cache_lv, 1, NULL, 0, 0)) {
- log_error("Cannot check status for locally inactive cache volume %s.",
- display_lvname(cache_lv));
- return 0;
- }
-
- log_debug_activation("Checking status for cache volume %s.",
- display_lvname(cache_lv));
-
if (!(dm = dev_manager_create(cache_lv->vg->cmd, cache_lv->vg->name, 1)))
return_0;
- if (!dev_manager_cache_status(dm, cache_lv, status)) {
+ if (!dev_manager_cache_status(dm, cache_lv, status, &exists)) {
dev_manager_destroy(dm);
- return_0;
+ if (exists)
+ stack;
+ return 0;
}
/* User has to call dm_pool_destroy(status->mem)! */
@@ -1258,19 +1252,16 @@ int lv_thin_pool_status(const struct logical_volume *lv, int flush,
struct lv_status_thin_pool **thin_pool_status)
{
struct dev_manager *dm;
-
- if (!lv_info(lv->vg->cmd, lv, 1, NULL, 0, 0))
- return 0;
-
- log_debug_activation("Checking thin pool status for LV %s.",
- display_lvname(lv));
+ int exists;
if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
return_0;
- if (!dev_manager_thin_pool_status(dm, lv, flush, thin_pool_status)) {
+ if (!dev_manager_thin_pool_status(dm, lv, flush, thin_pool_status, &exists)) {
dev_manager_destroy(dm);
- return_0;
+ if (exists)
+ stack;
+ return 0;
}
/* User has to call dm_pool_destroy(thin_pool_status->mem)! */
@@ -1282,19 +1273,16 @@ int lv_thin_status(const struct logical_volume *lv, int flush,
struct lv_status_thin **thin_status)
{
struct dev_manager *dm;
-
- if (!lv_info(lv->vg->cmd, lv, 0, NULL, 0, 0))
- return 0;
-
- log_debug_activation("Checking thin status for LV %s.",
- display_lvname(lv));
+ int exists;
if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
return_0;
- if (!dev_manager_thin_status(dm, lv, flush, thin_status)) {
+ if (!dev_manager_thin_status(dm, lv, flush, thin_status, &exists)) {
dev_manager_destroy(dm);
- return_0;
+ if (exists)
+ stack;
+ return 0;
}
/* User has to call dm_pool_destroy(thin_status->mem)! */
@@ -1304,20 +1292,16 @@ int lv_thin_status(const struct logical_volume *lv, int flush,
int lv_thin_device_id(const struct logical_volume *lv, uint32_t *device_id)
{
- int r;
struct dev_manager *dm;
-
- if (!lv_info(lv->vg->cmd, lv, 0, NULL, 0, 0))
- return 0;
-
- log_debug_activation("Checking device id for LV %s.",
- display_lvname(lv));
+ int exists;
+ int r;
if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
return_0;
- if (!(r = dev_manager_thin_device_id(dm, lv, device_id)))
- stack;
+ if (!(r = dev_manager_thin_device_id(dm, lv, device_id, &exists)))
+ if (exists)
+ stack;
dev_manager_destroy(dm);
@@ -1334,28 +1318,22 @@ int lv_thin_device_id(const struct logical_volume *lv, uint32_t *device_id)
int lv_vdo_pool_status(const struct logical_volume *lv, int flush,
struct lv_status_vdo **vdo_status)
{
- int r = 0;
struct dev_manager *dm;
-
- if (!lv_info(lv->vg->cmd, lv, 1, NULL, 0, 0))
- return 0;
-
- log_debug_activation("Checking VDO pool status for LV %s.",
- display_lvname(lv));
+ int exists;
if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, !lv_is_pvmove(lv))))
return_0;
- if (!dev_manager_vdo_pool_status(dm, lv, vdo_status, flush))
- goto_out;
+ if (!dev_manager_vdo_pool_status(dm, lv, flush, vdo_status, &exists)) {
+ dev_manager_destroy(dm);
+ if (exists)
+ stack;
+ return 0;
+ }
/* User has to call dm_pool_destroy(vdo_status->mem) */
- r = 1;
-out:
- if (!r)
- dev_manager_destroy(dm);
- return r;
+ return 1;
}
int lv_vdo_pool_percent(const struct logical_volume *lv, dm_percent_t *percent)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index aa88e6868..40b9ef31d 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1558,7 +1558,7 @@ out:
int dev_manager_cache_status(struct dev_manager *dm,
const struct logical_volume *lv,
- struct lv_status_cache **status)
+ struct lv_status_cache **status, int *exists)
{
int r = 0;
const char *dlid;
@@ -1569,14 +1569,18 @@ int dev_manager_cache_status(struct dev_manager *dm,
char *params = NULL;
struct dm_status_cache *c;
+ *exists = -1;
if (!(dlid = build_dm_uuid(dm->mem, lv, lv_layer(lv))))
return_0;
if (!(dmt = _setup_task_run(DM_DEVICE_STATUS, &info, NULL, dlid, 0, 0, 0, 0, 0, 0)))
return_0;
- if (!info.exists)
- goto_out;
+ if (!(*exists = info.exists))
+ goto out;
+
+ log_debug_activation("Checking status for cache volume %s.",
+ display_lvname(lv));
dm_get_next_target(dmt, NULL, &start, &length, &type, ¶ms);
@@ -1621,7 +1625,7 @@ out:
int dev_manager_thin_pool_status(struct dev_manager *dm,
const struct logical_volume *lv, int flush,
- struct lv_status_thin_pool **status)
+ struct lv_status_thin_pool **status, int *exists)
{
struct dm_status_thin_pool *dm_status;
const char *dlid;
@@ -1632,6 +1636,10 @@ int dev_manager_thin_pool_status(struct dev_manager *dm,
char *params = NULL;
int r = 0;
+ *exists = -1;
+ if (!(*status = dm_pool_zalloc(dm->mem, sizeof(struct lv_status_thin_pool))))
+ return_0;
+
/* Build dlid for the thin pool layer */
if (!(dlid = build_dm_uuid(dm->mem, lv, lv_layer(lv))))
return_0;
@@ -1639,8 +1647,11 @@ int dev_manager_thin_pool_status(struct dev_manager *dm,
if (!(dmt = _setup_task_run(DM_DEVICE_STATUS, &info, NULL, dlid, 0, 0, 0, 0, flush, 0)))
return_0;
- if (!info.exists)
- goto_out;
+ if (!(*exists = info.exists))
+ goto out;
+
+ log_debug_activation("Checking thin pool status for LV %s.",
+ display_lvname(lv));
dm_get_next_target(dmt, NULL, &start, &length, &type, ¶ms);
@@ -1653,9 +1664,6 @@ int dev_manager_thin_pool_status(struct dev_manager *dm,
if (!dm_get_status_thin_pool(dm->mem, params, &dm_status))
goto_out;
- if (!(*status = dm_pool_zalloc(dm->mem, sizeof(struct lv_status_thin_pool))))
- goto_out;
-
(*status)->mem = dm->mem;
(*status)->thin_pool = dm_status;
@@ -1678,7 +1686,7 @@ out:
int dev_manager_thin_status(struct dev_manager *dm,
const struct logical_volume *lv, int flush,
- struct lv_status_thin **status)
+ struct lv_status_thin **status, int *exists)
{
struct dm_status_thin *dm_status;
const char *dlid;
@@ -1690,14 +1698,21 @@ int dev_manager_thin_status(struct dev_manager *dm,
uint64_t csize;
int r = 0;
+ *exists = -1;
+ if (!(*status = dm_pool_zalloc(dm->mem, sizeof(struct lv_status_thin))))
+ return_0;
+
if (!(dlid = build_dm_uuid(dm->mem, lv, lv_layer(lv))))
return_0;
if (!(dmt = _setup_task_run(DM_DEVICE_STATUS, &info, NULL, dlid, 0, 0, 0, 0, flush, 0)))
return_0;
- if (!info.exists)
- goto_out;
+ if (!(*exists = info.exists))
+ goto out;
+
+ log_debug_activation("Checking thin status for LV %s.",
+ display_lvname(lv));
dm_get_next_target(dmt, NULL, &start, &length, &type, ¶ms);
@@ -1710,9 +1725,6 @@ int dev_manager_thin_status(struct dev_manager *dm,
if (!dm_get_status_thin(dm->mem, params, &dm_status))
goto_out;
- if (!(*status = dm_pool_zalloc(dm->mem, sizeof(struct lv_status_thin))))
- goto_out;
-
(*status)->mem = dm->mem;
(*status)->thin = dm_status;
@@ -1745,7 +1757,7 @@ out:
*/
int dev_manager_thin_device_id(struct dev_manager *dm,
const struct logical_volume *lv,
- uint32_t *device_id)
+ uint32_t *device_id, int *exists)
{
const char *dlid;
struct dm_task *dmt;
@@ -1755,6 +1767,7 @@ int dev_manager_thin_device_id(struct dev_manager *dm,
const char *layer = lv_layer(lv);
int r = 0;
+ *exists = -1;
if (lv_is_merging_origin(lv) && !lv_info(lv->vg->cmd, lv, 1, NULL, 0, 0))
/* If the merge has already happened, that table
* can already be using correct LV without -real layer */
@@ -1767,8 +1780,11 @@ int dev_manager_thin_device_id(struct dev_manager *dm,
if (!(dmt = _setup_task_run(DM_DEVICE_TABLE, &info, NULL, dlid, 0, 0, 0, 0, 1, 0)))
return_0;
- if (!info.exists)
- goto_out;
+ if (!(*exists = info.exists))
+ goto out;
+
+ log_debug_activation("Checking device id for LV %s.",
+ display_lvname(lv));
if (dm_get_next_target(dmt, NULL, &start, &length,
&target_type, ¶ms)) {
@@ -1797,11 +1813,9 @@ out:
}
int dev_manager_vdo_pool_status(struct dev_manager *dm,
- const struct logical_volume *lv,
- struct lv_status_vdo **vdo_status,
- int flush)
+ const struct logical_volume *lv, int flush,
+ struct lv_status_vdo **status, int *exists)
{
- struct lv_status_vdo *status;
const char *dlid;
struct dm_info info;
uint64_t start, length;
@@ -1810,12 +1824,9 @@ int dev_manager_vdo_pool_status(struct dev_manager *dm,
char *params = NULL;
int r = 0;
- *vdo_status = NULL;
-
- if (!(status = dm_pool_zalloc(dm->mem, sizeof(struct lv_status_vdo)))) {
- log_error("Cannot allocate VDO status structure.");
- return 0;
- }
+ *exists = -1;
+ if (!(*status = dm_pool_zalloc(dm->mem, sizeof(struct lv_status_vdo))))
+ return_0;
if (!(dlid = build_dm_uuid(dm->mem, lv, lv_layer(lv))))
return_0;
@@ -1823,8 +1834,11 @@ int dev_manager_vdo_pool_status(struct dev_manager *dm,
if (!(dmt = _setup_task_run(DM_DEVICE_STATUS, &info, NULL, dlid, 0, 0, 0, 0, flush, 0)))
return_0;
- if (!info.exists)
- goto_out;
+ if (!(*exists = info.exists))
+ goto out;
+
+ log_debug_activation("Checking VDO pool status for LV %s.",
+ display_lvname(lv));
if (dm_get_next_target(dmt, NULL, &start, &length, &type, ¶ms)) {
log_error("More then one table line found for %s.",
@@ -1838,11 +1852,10 @@ int dev_manager_vdo_pool_status(struct dev_manager *dm,
goto out;
}
- if (!parse_vdo_pool_status(dm->mem, lv, params, status))
+ if (!parse_vdo_pool_status(dm->mem, lv, params, *status))
goto_out;
- status->mem = dm->mem;
- *vdo_status = status;
+ (*status)->mem = dm->mem;
r = 1;
out:
diff --git a/lib/activate/dev_manager.h b/lib/activate/dev_manager.h
index 557418201..dcd08818d 100644
--- a/lib/activate/dev_manager.h
+++ b/lib/activate/dev_manager.h
@@ -68,20 +68,19 @@ int dev_manager_writecache_message(struct dev_manager *dm,
const char *msg);
int dev_manager_cache_status(struct dev_manager *dm,
const struct logical_volume *lv,
- struct lv_status_cache **status);
+ struct lv_status_cache **status, int *exists);
int dev_manager_thin_status(struct dev_manager *dm,
const struct logical_volume *lv, int flush,
- struct lv_status_thin **status);
+ struct lv_status_thin **status, int *exists);
int dev_manager_thin_device_id(struct dev_manager *dm,
const struct logical_volume *lv,
- uint32_t *device_id);
+ uint32_t *device_id, int *exist);
int dev_manager_thin_pool_status(struct dev_manager *dm,
const struct logical_volume *lv, int flush,
- struct lv_status_thin_pool **status);
+ struct lv_status_thin_pool **status, int *exists);
int dev_manager_vdo_pool_status(struct dev_manager *dm,
- const struct logical_volume *lv,
- struct lv_status_vdo **vdo_status,
- int flush);
+ const struct logical_volume *lv, int flush,
+ struct lv_status_vdo **status, int *exists);
int dev_manager_suspend(struct dev_manager *dm, const struct logical_volume *lv,
struct lv_activate_opts *laopts, int lockfs, int flush_required);
int dev_manager_activate(struct dev_manager *dm, const struct logical_volume *lv,
3 years, 1 month