master - tests: drop extra debug vvvv
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b876e8c915a9434fa94...
Commit: b876e8c915a9434fa947ceb447dab32d5ecc74d3
Parent: 7c84c5c421806d5ee3fbe885862839a27df7b36a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue May 30 12:58:32 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Tue May 30 18:43:56 2017 +0200
tests: drop extra debug vvvv
Also show output of mount so when it fails we can check the state.
---
test/shell/fsadm-renamed.sh | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/test/shell/fsadm-renamed.sh b/test/shell/fsadm-renamed.sh
index 3444840..5142e51 100644
--- a/test/shell/fsadm-renamed.sh
+++ b/test/shell/fsadm-renamed.sh
@@ -68,7 +68,8 @@ mount "$dev_vg_lv" "$mount_dir"
lvrename $vg_lv $vg_lv_ren
-mount | grep $vg
+mount | tee out
+grep $vg out
# fails on renamed LV
fail lvresize -L+10M -r $vg_lv_ren
@@ -88,7 +89,7 @@ not lvresize -L+10M -r $vg_lv_ren
umount "$mount_dir"
# FIXME: lvresize CANNOT handle/propagage '--yes' to fsadm
-echo y | lvresize -L+10M -vvvv -r $vg_lv
+echo y | lvresize -L+10M -r $vg_lv
umount "$mount_dolar_dir"
6 years, 11 months
master - tests: also check new flag with segtype
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7c84c5c421806d5ee3f...
Commit: 7c84c5c421806d5ee3fbe885862839a27df7b36a
Parent: fb86bddda2e2944699d9c0705a16642ed1dc99b5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue May 30 16:10:22 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Tue May 30 18:43:56 2017 +0200
tests: also check new flag with segtype
Make sure new unknown flag is having same behavior as old unknown segtype.
---
test/shell/unknown-segment.sh | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/test/shell/unknown-segment.sh b/test/shell/unknown-segment.sh
index 27cea88..20fc920 100644
--- a/test/shell/unknown-segment.sh
+++ b/test/shell/unknown-segment.sh
@@ -18,9 +18,10 @@ aux prepare_vg 4
lvcreate -an -Zn -l 1 -n $lv1 $vg
lvcreate -an -Zn -l 2 --type mirror -m 1 -n $lv2 $vg
+lvcreate -an -Zn --type zero -l 1 -n $lv3 $vg
vgcfgbackup -f bak0 $vg
-sed -e 's,striped,unstriped,;s,mirror,unmirror,' -i.orig bak0
+sed -e 's,striped,unstriped,;s,mirror,unmirror,;s,zero,zero+NEWFLAG,' -i.orig bak0
vgcfgrestore -f bak0 $vg
# we have on-disk metadata with unknown segments now
@@ -28,11 +29,13 @@ not lvchange -aey $vg/$lv1 # check that activation is refused
# try once more to catch invalid memory access with valgrind
# when clvmd flushes cmd mem pool
-not lvchange -aey $vg/$lv1 # check that activation is refused
+not lvchange -aey $vg/$lv2 # check that activation is refused
+
+not lvchange -aey $vg/$lv3 # check that activation is refused
vgcfgbackup -f bak1 $vg
cat bak1
-sed -e 's,unstriped,striped,;s,unmirror,mirror,' -i.orig bak1
+sed -e 's,unstriped,striped,;s,unmirror,mirror,;s,zero+NEWFLAG,zero,' -i.orig bak1
vgcfgrestore -f bak1 $vg
vgcfgbackup -f bak2 $vg
6 years, 11 months
master - flags: improve unknown flags logic
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fb86bddda2e2944699d...
Commit: fb86bddda2e2944699d9c0705a16642ed1dc99b5
Parent: d1ac6108c39ff8a3496624508a0e709c503d7d9f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue May 30 15:59:42 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Tue May 30 18:43:45 2017 +0200
flags: improve unknown flags logic
Use same logic as with unknown segment type - so preserve such
name fully with all flags just with UNKNOWN segment type bits.
---
lib/format_text/flags.c | 34 ++++++++++++++++++++++------------
1 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/lib/format_text/flags.c b/lib/format_text/flags.c
index 2b934da..d86ceb7 100644
--- a/lib/format_text/flags.c
+++ b/lib/format_text/flags.c
@@ -229,16 +229,22 @@ int read_segtype_lvflags(uint64_t *status, char *segtype_str)
unsigned i;
const struct flag *flags = _lv_flags;
char *delim;
- char *flag;
+ char *flag, *buffer, *str;
- if (!(delim = strchr(segtype_str, '+')))
+ if (!(str = strchr(segtype_str, '+')))
return 1; /* No flags */
- *delim = '\0'; /* Cut away 1st. '+' */
+ if (!(buffer = dm_strdup(str + 1))) {
+ log_error("Cannot duplicate segment string.");
+ return 0;
+ }
+
+ delim = buffer;
+
do {
- flag = delim + 1;
- if ((delim = strchr(segtype_str, '+')))
- *delim = '\0';
+ flag = delim;
+ if ((delim = strchr(delim, '+')))
+ *delim++ = '\0';
for (i = 0; flags[i].description; i++)
if ((flags[i].kind & SEGTYPE_FLAG) &&
@@ -247,12 +253,16 @@ int read_segtype_lvflags(uint64_t *status, char *segtype_str)
break;
}
- if (!flags[i].description) {
- log_error("Unknown flag %s passed with segment type %s.",
- flag, segtype_str);
- return 0; /* Unknown flag is incompatible */
- }
- } while (delim); /* Till no more flags in type appear */
+ } while (delim && flags[i].description); /* Till no more flags in type appear */
+
+ if (!flags[i].description)
+ /* Unknown flag is incompatible - returns unmodified segtype_str */
+ log_warn("WARNING: Unrecognised flag %s in segment type %s.",
+ flag, segtype_str);
+ else
+ *str = '\0'; /* Cut away 1st. '+' */
+
+ dm_free(buffer);
return 1;
}
6 years, 11 months
master - tests: missed to export lvm binary for fsadm
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=58289ceadd3076cd5e4...
Commit: 58289ceadd3076cd5e4e18cff0e128c7855df9d6
Parent: de663f48a15bf8934b616c8dd7f736e3d2b65b2d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue May 30 12:59:21 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue May 30 16:19:01 2017 +0200
tests: missed to export lvm binary for fsadm
---
test/shell/lvresize-full.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvresize-full.sh b/test/shell/lvresize-full.sh
index 17ee6aa..3eef11a 100644
--- a/test/shell/lvresize-full.sh
+++ b/test/shell/lvresize-full.sh
@@ -20,6 +20,7 @@ SKIP_WITH_LVMPOLLD=1
FSCK=${FSCK-fsck}
MKFS=${MKFS-mkfs.ext3}
RESIZEFS=${RESIZEFS-resize2fs}
+export LVM_BINARY=$(which lvm)
which $FSCK || skip
which $MKFS || skip
6 years, 11 months
master - tests: drop extra debug vvvv
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=de663f48a15bf8934b6...
Commit: de663f48a15bf8934b616c8dd7f736e3d2b65b2d
Parent: 888994036549ed0201e1d6fd6f84a0127ce27cbe
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue May 30 12:58:32 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue May 30 16:19:01 2017 +0200
tests: drop extra debug vvvv
Also show output of mount so when it fails we can check the state.
---
test/shell/fsadm-renamed.sh | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/test/shell/fsadm-renamed.sh b/test/shell/fsadm-renamed.sh
index 3444840..5142e51 100644
--- a/test/shell/fsadm-renamed.sh
+++ b/test/shell/fsadm-renamed.sh
@@ -68,7 +68,8 @@ mount "$dev_vg_lv" "$mount_dir"
lvrename $vg_lv $vg_lv_ren
-mount | grep $vg
+mount | tee out
+grep $vg out
# fails on renamed LV
fail lvresize -L+10M -r $vg_lv_ren
@@ -88,7 +89,7 @@ not lvresize -L+10M -r $vg_lv_ren
umount "$mount_dir"
# FIXME: lvresize CANNOT handle/propagage '--yes' to fsadm
-echo y | lvresize -L+10M -vvvv -r $vg_lv
+echo y | lvresize -L+10M -r $vg_lv
umount "$mount_dolar_dir"
6 years, 11 months
master - tests: also check new flag with segtype
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=888994036549ed0201e...
Commit: 888994036549ed0201e1d6fd6f84a0127ce27cbe
Parent: f22ac7229bf69416aaab4be5c7057c0662f188a5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue May 30 16:10:22 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue May 30 16:19:01 2017 +0200
tests: also check new flag with segtype
Make sure new unknown flag is having same behavior as old unknown segtype.
---
test/shell/unknown-segment.sh | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/test/shell/unknown-segment.sh b/test/shell/unknown-segment.sh
index 27cea88..20fc920 100644
--- a/test/shell/unknown-segment.sh
+++ b/test/shell/unknown-segment.sh
@@ -18,9 +18,10 @@ aux prepare_vg 4
lvcreate -an -Zn -l 1 -n $lv1 $vg
lvcreate -an -Zn -l 2 --type mirror -m 1 -n $lv2 $vg
+lvcreate -an -Zn --type zero -l 1 -n $lv3 $vg
vgcfgbackup -f bak0 $vg
-sed -e 's,striped,unstriped,;s,mirror,unmirror,' -i.orig bak0
+sed -e 's,striped,unstriped,;s,mirror,unmirror,;s,zero,zero+NEWFLAG,' -i.orig bak0
vgcfgrestore -f bak0 $vg
# we have on-disk metadata with unknown segments now
@@ -28,11 +29,13 @@ not lvchange -aey $vg/$lv1 # check that activation is refused
# try once more to catch invalid memory access with valgrind
# when clvmd flushes cmd mem pool
-not lvchange -aey $vg/$lv1 # check that activation is refused
+not lvchange -aey $vg/$lv2 # check that activation is refused
+
+not lvchange -aey $vg/$lv3 # check that activation is refused
vgcfgbackup -f bak1 $vg
cat bak1
-sed -e 's,unstriped,striped,;s,unmirror,mirror,' -i.orig bak1
+sed -e 's,unstriped,striped,;s,unmirror,mirror,;s,zero+NEWFLAG,zero,' -i.orig bak1
vgcfgrestore -f bak1 $vg
vgcfgbackup -f bak2 $vg
6 years, 11 months
master - flags: improve unknonw flags logic
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f22ac7229bf69416aaa...
Commit: f22ac7229bf69416aaab4be5c7057c0662f188a5
Parent: d1ac6108c39ff8a3496624508a0e709c503d7d9f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue May 30 15:59:42 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue May 30 16:18:05 2017 +0200
flags: improve unknonw flags logic
Use same logic as with unknown segment type - so preserve such
name fully with all flags just with UNKNOWN segment type bits.
---
lib/format_text/flags.c | 34 ++++++++++++++++++++++------------
1 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/lib/format_text/flags.c b/lib/format_text/flags.c
index 2b934da..d86ceb7 100644
--- a/lib/format_text/flags.c
+++ b/lib/format_text/flags.c
@@ -229,16 +229,22 @@ int read_segtype_lvflags(uint64_t *status, char *segtype_str)
unsigned i;
const struct flag *flags = _lv_flags;
char *delim;
- char *flag;
+ char *flag, *buffer, *str;
- if (!(delim = strchr(segtype_str, '+')))
+ if (!(str = strchr(segtype_str, '+')))
return 1; /* No flags */
- *delim = '\0'; /* Cut away 1st. '+' */
+ if (!(buffer = dm_strdup(str + 1))) {
+ log_error("Cannot duplicate segment string.");
+ return 0;
+ }
+
+ delim = buffer;
+
do {
- flag = delim + 1;
- if ((delim = strchr(segtype_str, '+')))
- *delim = '\0';
+ flag = delim;
+ if ((delim = strchr(delim, '+')))
+ *delim++ = '\0';
for (i = 0; flags[i].description; i++)
if ((flags[i].kind & SEGTYPE_FLAG) &&
@@ -247,12 +253,16 @@ int read_segtype_lvflags(uint64_t *status, char *segtype_str)
break;
}
- if (!flags[i].description) {
- log_error("Unknown flag %s passed with segment type %s.",
- flag, segtype_str);
- return 0; /* Unknown flag is incompatible */
- }
- } while (delim); /* Till no more flags in type appear */
+ } while (delim && flags[i].description); /* Till no more flags in type appear */
+
+ if (!flags[i].description)
+ /* Unknown flag is incompatible - returns unmodified segtype_str */
+ log_warn("WARNING: Unrecognised flag %s in segment type %s.",
+ flag, segtype_str);
+ else
+ *str = '\0'; /* Cut away 1st. '+' */
+
+ dm_free(buffer);
return 1;
}
6 years, 11 months
master - flags: restore same logic with MISSING
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d1ac6108c39ff8a3496...
Commit: d1ac6108c39ff8a3496624508a0e709c503d7d9f
Parent: 4141409eb09e78aef030346995f1722fb40956d8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue May 30 16:12:45 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue May 30 16:16:29 2017 +0200
flags: restore same logic with MISSING
Since lvmetad is using 'MISSING' in status for 'another' purpose,
we need to support ATM also flag get from this place.
Until fixed better - we accept both flags - alhough lvm2 will
only print in flags.
---
lib/format_text/flags.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/format_text/flags.c b/lib/format_text/flags.c
index 04896f4..2b934da 100644
--- a/lib/format_text/flags.c
+++ b/lib/format_text/flags.c
@@ -47,6 +47,7 @@ static const struct flag _pv_flags[] = {
{ALLOCATABLE_PV, "ALLOCATABLE", STATUS_FLAG},
{EXPORTED_VG, "EXPORTED", STATUS_FLAG},
{MISSING_PV, "MISSING", COMPATIBLE_FLAG},
+ {MISSING_PV, "MISSING", STATUS_FLAG},
{UNLABELLED_PV, NULL, 0},
{0, NULL, 0}
};
6 years, 11 months
master - lvmetad: store MISSSING flag properly
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=148ad25f4c14274d920...
Commit: 148ad25f4c14274d920af477b1ca7084874eb615
Parent: 4141409eb09e78aef030346995f1722fb40956d8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 29 16:18:29 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 29 16:20:00 2017 +0200
lvmetad: store MISSSING flag properly
PV MISSING flag is compatible flag, not a status (incompatible) flag.
---
WHATS_NEW | 1 +
daemons/lvmetad/lvmetad-core.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 878aa7a..0743c1f 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.172 -
===============================
+ Store MISSING PV in proper field in lvmetad.
Cache format2 flag is now using segment name type field.
Support storing status flags via segtype name field.
Stop using '--yes' mode when fsadm runs without terminal.
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index af5d429..242df98 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -360,7 +360,7 @@ static int update_pv_status(lvmetad_state *s,
pvmeta = dm_hash_lookup(s->pvid_to_pvmeta, uuid);
- set_flag(cft, pv, "status", "MISSING", !pvmeta);
+ set_flag(cft, pv, "flags", "MISSING", !pvmeta);
if (pvmeta) {
if (!(pvmeta_cn = dm_config_clone_node(cft, pvmeta->root->child, 1))) {
6 years, 11 months
master - flags: add segtype flag support
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4141409eb09e78aef03...
Commit: 4141409eb09e78aef030346995f1722fb40956d8
Parent: 0299a7af1ec1eeb11388ed15c4c78f224fee76b2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon May 29 14:20:38 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon May 29 14:52:56 2017 +0200
flags: add segtype flag support
Switch METADATA_FORMAT flag usage to be stored via segtype
instead of 'status' flag which appeared to cause major
incompatibility troubles.
For backward compatiblity segtype flags are still accepted also
via 'status' bits which were used from version 2.02.169 so metadata
saved by this newer lvm2 version should still work nicely, although
new save version will no longer work on this older lvm2 version.
---
WHATS_NEW | 1 +
lib/format_text/export.c | 8 +++++++-
lib/format_text/flags.c | 4 ++--
lib/format_text/import-export.h | 1 +
lib/format_text/import_vsn1.c | 21 +++++++++++++++++++--
5 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index de65e0e..878aa7a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.172 -
===============================
+ Cache format2 flag is now using segment name type field.
Support storing status flags via segtype name field.
Stop using '--yes' mode when fsadm runs without terminal.
Extend validation of filesystems resized by fsadm.
diff --git a/lib/format_text/export.c b/lib/format_text/export.c
index 829b46d..f369089 100644
--- a/lib/format_text/export.c
+++ b/lib/format_text/export.c
@@ -584,6 +584,11 @@ static int _print_pvs(struct formatter *f, struct volume_group *vg)
static int _print_segment(struct formatter *f, struct volume_group *vg,
int count, struct lv_segment *seg)
{
+ char buffer[2048];
+
+ if (!print_segtype_lvflags(buffer, sizeof(buffer), seg->lv->status))
+ return_0;
+
outf(f, "segment%u {", count);
_inc_indent(f);
@@ -594,7 +599,8 @@ static int _print_segment(struct formatter *f, struct volume_group *vg,
if (seg->reshape_len)
outsize(f, (uint64_t) seg->reshape_len * vg->extent_size,
"reshape_count = %u", seg->reshape_len);
- outf(f, "type = \"%s\"", seg->segtype->name);
+
+ outf(f, "type = \"%s%s\"", seg->segtype->name, buffer);
if (!_out_list(f, &seg->tags, "tags"))
return_0;
diff --git a/lib/format_text/flags.c b/lib/format_text/flags.c
index 64bad1c..04896f4 100644
--- a/lib/format_text/flags.c
+++ b/lib/format_text/flags.c
@@ -67,7 +67,7 @@ static const struct flag _lv_flags[] = {
{LV_WRITEMOSTLY, "WRITEMOSTLY", STATUS_FLAG},
{LV_ACTIVATION_SKIP, "ACTIVATION_SKIP", COMPATIBLE_FLAG},
{LV_ERROR_WHEN_FULL, "ERROR_WHEN_FULL", COMPATIBLE_FLAG},
- {LV_METADATA_FORMAT, "METADATA_FORMAT", STATUS_FLAG},
+ {LV_METADATA_FORMAT, "METADATA_FORMAT", SEGTYPE_FLAG},
{LV_NOSCAN, NULL, 0},
{LV_TEMPORARY, NULL, 0},
{POOL_METADATA_SPARE, NULL, 0},
@@ -138,7 +138,7 @@ int print_flags(char *buffer, size_t size, enum pv_vg_lv_e type, int mask, uint6
if (status & flags[f].mask) {
status &= ~flags[f].mask;
- if ((type & STATUS_FLAG) != flags[f].kind)
+ if (mask != flags[f].kind)
continue;
/* Internal-only flag? */
diff --git a/lib/format_text/import-export.h b/lib/format_text/import-export.h
index abb9b0e..4b47636 100644
--- a/lib/format_text/import-export.h
+++ b/lib/format_text/import-export.h
@@ -43,6 +43,7 @@ enum pv_vg_lv_e {
#define COMPATIBLE_FLAG 0x01
#define STATUS_FLAG 0x02
+#define SEGTYPE_FLAG 0x04
struct text_vg_version_ops {
int (*check_version) (const struct dm_config_tree * cf);
diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c
index 6acfe1d..7d9257e 100644
--- a/lib/format_text/import_vsn1.c
+++ b/lib/format_text/import_vsn1.c
@@ -140,7 +140,8 @@ static int _read_flag_config(const struct dm_config_node *n, uint64_t *status, i
return 0;
}
- if (!(read_flags(status, type, STATUS_FLAG, cv))) {
+ /* For backward compatible metadata accept both type of flags */
+ if (!(read_flags(status, type, STATUS_FLAG | SEGTYPE_FLAG, cv))) {
log_error("Could not read status flags.");
return 0;
}
@@ -357,6 +358,7 @@ static int _read_segment(struct logical_volume *lv, const struct dm_config_node
uint32_t area_extents, start_extent, extent_count, reshape_count, data_copies;
struct segment_type *segtype;
const char *segtype_str;
+ char *segtype_with_flags;
if (!sn_child) {
log_error("Empty segment section.");
@@ -388,9 +390,24 @@ static int _read_segment(struct logical_volume *lv, const struct dm_config_node
return 0;
}
- if (!(segtype = get_segtype_from_string(lv->vg->cmd, segtype_str)))
+ /* Locally duplicate to parse out status flag bits */
+ if (!(segtype_with_flags = dm_pool_strdup(mem, segtype_str))) {
+ log_error("Cannot duplicate segtype string.");
+ return 0;
+ }
+
+ if (!read_segtype_lvflags(&lv->status, segtype_with_flags)) {
+ log_error("Couldn't read segtype for logical volume %s.",
+ display_lvname(lv));
+ return 0;
+ }
+
+ if (!(segtype = get_segtype_from_string(lv->vg->cmd, segtype_with_flags)))
return_0;
+ /* Can drop temporary string here as nothing has allocated from VGMEM meanwhile */
+ dm_pool_free(mem, segtype_with_flags);
+
if (segtype->ops->text_import_area_count &&
!segtype->ops->text_import_area_count(sn_child, &area_count))
return_0;
6 years, 11 months