master - configure: warn about older version of cache_check
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=358eee15f30778bc20c...
Commit: 358eee15f30778bc20c2723532bffdf1d8176684
Parent: 1c916ec5ffd37cfb7be2101b93a2dc91aa2ef7f0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 9 22:30:23 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 9 22:32:12 2017 +0200
configure: warn about older version of cache_check
For proper usage of Cache kernel metadata format V2,
new cache_check tool is basically mandatory.
Print warning during configure time about this problem.
---
configure | 15 +++++++++++++--
configure.in | 10 +++++++++-
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 28b0488..9d0d97c 100755
--- a/configure
+++ b/configure
@@ -9256,6 +9256,11 @@ $as_echo "$as_me: WARNING: $CACHE_CHECK_CMD: Old version \"$CACHE_CHECK_VSN\" fo
CACHE_CHECK_VERSION_WARN=y
CACHE_CHECK_NEEDS_CHECK=no
fi
+ if test "$CACHE_CHECK_VSN_MINOR" -lt 7 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $CACHE_CHECK_CMD: Old version \"$CACHE_CHECK_VSN\" does not support new cache format V2" >&5
+$as_echo "$as_me: WARNING: $CACHE_CHECK_CMD: Old version \"$CACHE_CHECK_VSN\" does not support new cache format V2" >&2;}
+ CACHE_CHECK_VERSION_WARN=y
+ fi
fi
fi
# Empty means a config way to ignore cache dumping
@@ -17044,8 +17049,8 @@ $as_echo "$as_me: WARNING: Support for thin provisioning is limited since some t
fi
if test -n "$THIN_CHECK_VERSION_WARN"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You should also install thin_check vsn 0.3.2 (or later) to use lvm2 thin provisioning" >&5
-$as_echo "$as_me: WARNING: You should also install thin_check vsn 0.3.2 (or later) to use lvm2 thin provisioning" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You should also install latest thin_check vsn 0.7.0 (or later) for lvm2 thin provisioning" >&5
+$as_echo "$as_me: WARNING: You should also install latest thin_check vsn 0.7.0 (or later) for lvm2 thin provisioning" >&2;}
fi
if test -n "$CACHE_CONFIGURE_WARN"; then :
@@ -17053,6 +17058,12 @@ if test -n "$CACHE_CONFIGURE_WARN"; then :
$as_echo "$as_me: WARNING: Support for cache is limited since some cache tools are missing!" >&2;}
fi
+if test -n "$CACHE_CHECK_VERSION_WARN"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You should install latest cache_check vsn 0.7.0 to use lvm2 cache metadata format 2" >&5
+$as_echo "$as_me: WARNING: You should install latest cache_check vsn 0.7.0 to use lvm2 cache metadata format 2" >&2;}
+fi
+
+
if test "$ODIRECT" != yes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: O_DIRECT disabled: low-memory pvmove may lock up" >&5
$as_echo "$as_me: WARNING: O_DIRECT disabled: low-memory pvmove may lock up" >&2;}
diff --git a/configure.in b/configure.in
index 8603a12..0ca6b43 100644
--- a/configure.in
+++ b/configure.in
@@ -617,6 +617,10 @@ case "$CACHE" in
CACHE_CHECK_VERSION_WARN=y
CACHE_CHECK_NEEDS_CHECK=no
fi
+ if test "$CACHE_CHECK_VSN_MINOR" -lt 7 ; then
+ AC_MSG_WARN([$CACHE_CHECK_CMD: Old version "$CACHE_CHECK_VSN" does not support new cache format V2])
+ CACHE_CHECK_VERSION_WARN=y
+ fi
fi
fi
# Empty means a config way to ignore cache dumping
@@ -2256,10 +2260,14 @@ AS_IF([test -n "$THIN_CONFIGURE_WARN"],
[AC_MSG_WARN([Support for thin provisioning is limited since some thin provisioning tools are missing!])])
AS_IF([test -n "$THIN_CHECK_VERSION_WARN"],
- [AC_MSG_WARN([You should also install thin_check vsn 0.3.2 (or later) to use lvm2 thin provisioning])])
+ [AC_MSG_WARN([You should also install latest thin_check vsn 0.7.0 (or later) for lvm2 thin provisioning])])
AS_IF([test -n "$CACHE_CONFIGURE_WARN"],
[AC_MSG_WARN([Support for cache is limited since some cache tools are missing!])])
+AS_IF([test -n "$CACHE_CHECK_VERSION_WARN"],
+ [AC_MSG_WARN([You should install latest cache_check vsn 0.7.0 to use lvm2 cache metadata format 2])])
+
+
AS_IF([test "$ODIRECT" != yes],
[AC_MSG_WARN([O_DIRECT disabled: low-memory pvmove may lock up])])
6 years, 10 months
master - raid: add reshape segtype flag support
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1c916ec5ffd37cfb7be...
Commit: 1c916ec5ffd37cfb7be2101b93a2dc91aa2ef7f0
Parent: 305513178474d15adcba4785871c3f0321576fbe
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Fri Jun 9 21:31:09 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Fri Jun 9 22:23:04 2017 +0200
raid: add reshape segtype flag support
Prohibit activation of reshaping RaidLVs on incompatible
lvm2 runtime by storing e.g. 'raid5+RESHAPE' segment type
strings in the lvm2 metadata. Incompatible runtime not
supporting reshaping won't be able to activate those thus
avoiding potential data corruption.
Any new non-reshaping lvconvert command will reset the
segment type string from 'raid5+RESHAPE' to 'raid5'.
See commits
0299a7af1ec1eeb11388ed15c4c78f224fee76b2 and
4141409eb09e78aef030346995f1722fb40956d8
for segtype flag support.
---
lib/format_text/flags.c | 1 +
lib/metadata/metadata-exported.h | 5 ++++-
lib/metadata/raid_manip.c | 17 ++++++++++++++++-
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/lib/format_text/flags.c b/lib/format_text/flags.c
index d86ceb7..a9548e0 100644
--- a/lib/format_text/flags.c
+++ b/lib/format_text/flags.c
@@ -62,6 +62,7 @@ static const struct flag _lv_flags[] = {
{LOCKED, "LOCKED", STATUS_FLAG},
{LV_NOTSYNCED, "NOTSYNCED", STATUS_FLAG},
{LV_REBUILD, "REBUILD", STATUS_FLAG},
+ {LV_RESHAPE, "RESHAPE", SEGTYPE_FLAG},
{LV_RESHAPE_DELTA_DISKS_PLUS, "RESHAPE_DELTA_DISKS_PLUS", STATUS_FLAG},
{LV_RESHAPE_DELTA_DISKS_MINUS, "RESHAPE_DELTA_DISKS_MINUS", STATUS_FLAG},
{LV_REMOVE_AFTER_RESHAPE, "REMOVE_AFTER_RESHAPE", STATUS_FLAG},
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 8b4310b..c4bebd0 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -142,7 +142,10 @@
#define LV_REMOVE_AFTER_RESHAPE UINT64_C(0x0400000000000000) /* LV needs to be removed after a shrinking reshape */
#define LV_METADATA_FORMAT UINT64_C(0x0800000000000000) /* LV has segments with metadata format */
-/* Next unused flag: UINT64_C(0x1000000000000000) */
+
+#define LV_RESHAPE UINT64_C(0x1000000000000000) /* Ongoing reshape (number of stripes, stripesize or raid algorithm change):
+ used as SEGTYPE_FLAG to prevent activation on old runtime */
+/* Next unused flag: UINT64_C(0x2000000000000000) */
/* Format features flags */
#define FMT_SEGMENTS 0x00000001U /* Arbitrary segment params? */
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 5db4a8e..fd51964 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -1637,6 +1637,8 @@ static int _lv_free_reshape_space_with_status(struct logical_volume *lv, enum al
} else if (where_it_was)
*where_it_was = alloc_none;
+ lv->status &= ~LV_RESHAPE;
+
return 1;
}
@@ -1844,6 +1846,9 @@ static int _raid_reshape_add_images(struct logical_volume *lv,
seg->stripe_size = new_stripe_size;
+ /* Define image adding reshape (used as SEGTYPE_FLAG to avoid incompatible activations on old runtime) */
+ lv->status |= LV_RESHAPE;
+
return 1;
}
@@ -1943,6 +1948,8 @@ static int _raid_reshape_remove_images(struct logical_volume *lv,
if (seg_is_any_raid5(seg) && new_image_count == 2)
seg->data_copies = 2;
+ /* Define image removing reshape (used as SEGTYPE_FLAG to avoid incompatible activations on old runtime) */
+ lv ->status |= LV_RESHAPE;
break;
case 1:
@@ -1981,7 +1988,6 @@ static int _raid_reshape_remove_images(struct logical_volume *lv,
return 0;
seg->area_count = new_image_count;
-
break;
default:
@@ -2054,6 +2060,9 @@ static int _raid_reshape_keep_images(struct logical_volume *lv,
seg->segtype = new_segtype;
+ /* Define stripesize/raid algorithm reshape (used as SEGTYPE_FLAG to avoid incompatible activations on old runtime) */
+ lv->status |= LV_RESHAPE;
+
return 1;
}
@@ -2237,6 +2246,8 @@ static int _raid_reshape(struct logical_volume *lv,
return 0;
}
+ lv->status &= ~LV_RESHAPE; /* Reset any reshaping segtype flag */
+
dm_list_init(&removal_lvs);
/* No change in layout requested ? */
@@ -6040,6 +6051,8 @@ static int _region_size_change_requested(struct logical_volume *lv, int yes, con
return 0;
}
+ lv->status &= ~LV_RESHAPE;
+
if (!lv_update_and_reload_origin(lv))
return_0;
@@ -6291,6 +6304,8 @@ int lv_raid_convert(struct logical_volume *lv,
return 0;
}
+ lv->status &= ~LV_RESHAPE;
+
return takeover_fn(lv, new_segtype, yes, force, new_image_count, 0, new_stripes, stripe_size,
region_size, allocate_pvs);
}
6 years, 10 months
master - indent: properly indent goto
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=305513178474d15adcb...
Commit: 305513178474d15adcba4785871c3f0321576fbe
Parent: 57379157f4209acc72e943e26209b084575f811c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 9 14:52:40 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 9 21:49:19 2017 +0200
indent: properly indent goto
---
tools/reporter.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/reporter.c b/tools/reporter.c
index 912d3ab..b9c4153 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -240,7 +240,7 @@ static int _do_segs_with_info_and_status_single(struct cmd_context *cmd,
if (!report_object(sh ? : handle->custom_handle, sh != NULL,
seg->lv->vg, seg->lv, NULL, seg, NULL, &status, NULL))
- goto_out;
+ goto_out;
r = ECMD_PROCESSED;
out:
6 years, 10 months
master - cleanup: update message
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=57379157f4209acc72e...
Commit: 57379157f4209acc72e943e26209b084575f811c
Parent: db5938a4f8b5f13f5bc804f0d8e931f36dcbbef3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 9 21:31:02 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 9 21:49:19 2017 +0200
cleanup: update message
---
lib/metadata/thin_manip.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index 7f7d314..ad45ce9 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -718,7 +718,7 @@ int update_thin_pool_params(struct cmd_context *cmd,
return 0;
}
- log_print_unless_silent("Thin pool data with chunk size %s can address at most %s of data.",
+ log_print_unless_silent("Thin pool volume with chunk size %s can address at most %s of data.",
display_size(cmd, *chunk_size), display_size(cmd, max_pool_data_size));
if (!validate_thin_pool_chunk_size(cmd, *chunk_size))
6 years, 10 months
master - cleanup: define really uses KB
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=db5938a4f8b5f13f5bc...
Commit: db5938a4f8b5f13f5bc804f0d8e931f36dcbbef3
Parent: 5e7db7d85de7285eaee1867c73c10ee212c00631
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 9 21:29:34 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 9 21:49:19 2017 +0200
cleanup: define really uses KB
Cleanup also units for DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE define
(128MB) and update calcs for it.
---
lib/config/defaults.h | 2 +-
lib/metadata/thin_manip.c | 2 +-
liblvm/lvm_lv.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 51542df..d9e19d9 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -106,7 +106,7 @@
#define DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS 0
#define DEFAULT_THIN_POOL_MAX_METADATA_SIZE (DM_THIN_MAX_METADATA_SIZE / 2) /* KB */
#define DEFAULT_THIN_POOL_MIN_METADATA_SIZE 2048 /* KB */
-#define DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE (128 * 1024 * 1024) /* KB */
+#define DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE (128 * 1024) /* KB */
#define DEFAULT_THIN_POOL_CHUNK_SIZE_POLICY "generic"
#define DEFAULT_THIN_POOL_CHUNK_SIZE 64 /* KB */
#define DEFAULT_THIN_POOL_CHUNK_SIZE_PERFORMANCE 512 /* KB */
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index 726b26b..7f7d314 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -673,7 +673,7 @@ int update_thin_pool_params(struct cmd_context *cmd,
/* Check if we should eventually use bigger chunk size */
while ((pool_metadata_size >
- (DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE / SECTOR_SIZE)) &&
+ (DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE * 2)) &&
(*chunk_size < DM_THIN_MAX_DATA_BLOCK_SIZE)) {
*chunk_size <<= 1;
pool_metadata_size >>= 1;
diff --git a/liblvm/lvm_lv.c b/liblvm/lvm_lv.c
index 46fc3d9..13d6cbf 100644
--- a/liblvm/lvm_lv.c
+++ b/liblvm/lvm_lv.c
@@ -507,7 +507,7 @@ static int _lv_set_pool_params(struct lvcreate_params *lp,
pool_metadata_size = extents * vg->extent_size /
(lp->chunk_size * (SECTOR_SIZE / 64));
while ((pool_metadata_size >
- (2 * DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE / SECTOR_SIZE)) &&
+ (DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE * 2)) &&
lp->chunk_size < DM_THIN_MAX_DATA_BLOCK_SIZE) {
lp->chunk_size <<= 1;
pool_metadata_size >>= 1;
6 years, 10 months
master - snapshot: fix reporting for merged old snapshot
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5e7db7d85de7285eaee...
Commit: 5e7db7d85de7285eaee1867c73c10ee212c00631
Parent: b6945b85106620cb79730070e9a38ed93e7fc35a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 9 21:00:05 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 9 21:03:20 2017 +0200
snapshot: fix reporting for merged old snapshot
When old snapshot is merged, lvm2 still can report some data about
merged 'snapshot' - i.e. it occupied space in VG.
This patch fixes regression from commit:
6fd20be629b6dceb96702c5f875a2e612e6f465d
and resolved RHBZ: 1460161
---
lib/activate/activate.c | 1 -
tools/reporter.c | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index a3978ad..282dd4f 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -835,7 +835,6 @@ int lv_info_with_seg_status(struct cmd_context *cmd,
* When merge is in progress, query merging origin LV instead.
* COW volume is already mapped as error target in this case.
*/
- status->lv = olv;
return 1;
}
diff --git a/tools/reporter.c b/tools/reporter.c
index 980f39c..912d3ab 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -172,7 +172,7 @@ static int _do_lvs_with_info_and_status_single(struct cmd_context *cmd,
if (lv_is_merging_origin(lv)) {
if (!_check_merging_origin(lv, &status, &merged))
goto_out;
- if (merged)
+ if (merged && lv_is_thin_volume(lv->snapshot->lv))
lv = lv->snapshot->lv;
}
@@ -234,7 +234,7 @@ static int _do_segs_with_info_and_status_single(struct cmd_context *cmd,
if (lv_is_merging_origin(seg->lv)) {
if (!_check_merging_origin(seg->lv, &status, &merged))
goto_out;
- if (merged)
+ if (merged && lv_is_thin_volume(seg->lv->snapshot->lv))
seg = seg->lv->snapshot;
}
6 years, 10 months
master - tests: no longer allowed too big thin-pools for small chunks
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b6945b85106620cb797...
Commit: b6945b85106620cb79730070e9a38ed93e7fc35a
Parent: 5017284709102834c21bed408e54fccde8523d51
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 9 12:58:25 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 9 13:03:42 2017 +0200
tests: no longer allowed too big thin-pools for small chunks
---
test/shell/lvconvert-thin.sh | 2 +-
test/shell/lvcreate-thin-big.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvconvert-thin.sh b/test/shell/lvconvert-thin.sh
index c08b95a..992a1f2 100644
--- a/test/shell/lvconvert-thin.sh
+++ b/test/shell/lvconvert-thin.sh
@@ -135,7 +135,7 @@ lvremove -f $vg
if test "$TSIZE" = 64T; then
lvcreate -L24T -n $lv1 $vg
# Warning about bigger then needed (24T data and 16G -> 128K chunk)
-lvconvert --yes -c 64 --thinpool $vg/$lv1 2>&1 | tee err
+fail lvconvert --yes -c 64 --thinpool $vg/$lv1 2>&1 | tee err
grep "WARNING: Chunk size is too small" err
lvremove -f $vg
fi
diff --git a/test/shell/lvcreate-thin-big.sh b/test/shell/lvcreate-thin-big.sh
index da7812f..9c84288 100644
--- a/test/shell/lvcreate-thin-big.sh
+++ b/test/shell/lvcreate-thin-big.sh
@@ -36,7 +36,7 @@ grep "WARNING: Minimum" out
lvcreate -L4M --chunksize 64k --poolmetadatasize 17G -T $vg/pool2 2>out
grep "WARNING: Maximum" out
check lv_field $vg/pool1_tmeta size "2.00m"
-check lv_field $vg/pool2_tmeta size "16.00g"
+check lv_field $vg/pool2_tmeta size "15.81g"
# Check can start and see thinpool with metadata size above kernel limit
lvcreate -L4M --poolmetadatasize 16G -T $vg/poolM
6 years, 10 months
master - configure: report yes or no for wiping and system
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5017284709102834c21...
Commit: 5017284709102834c21bed408e54fccde8523d51
Parent: b3ef051e0637ac7f72ab245342e5a29394071c24
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 9 12:56:55 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 9 13:02:18 2017 +0200
configure: report yes or no for wiping and system
Avoid reporting 'checking result' as maybe - it should
clearly tell 'yes' or 'no'.
Just shuffle printed message to the place, where we
already know the 'maybe' answer.
So instead of printing 'unclear':
checking whether to enable libblkid detection of signatures when wiping... maybe
checking for BLKID... yes
checking whether to use udev-systemd protocol for jobs in background... maybe
checking for SYSTEMD... yes
show this:
checking for BLKID... yes
checking whether to enable libblkid detection of signatures when wiping... yes
checking for SYSTEMD... yes
checking whether to use udev-systemd protocol for jobs in background... yes
---
configure | 35 ++++++++++++++++-------------------
configure.in | 28 ++++++++++++----------------
2 files changed, 28 insertions(+), 35 deletions(-)
diff --git a/configure b/configure
index ffef9b9..28b0488 100755
--- a/configure
+++ b/configure
@@ -12223,8 +12223,6 @@ fi
################################################################################
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable libblkid detection of signatures when wiping" >&5
-$as_echo_n "checking whether to enable libblkid detection of signatures when wiping... " >&6; }
# Check whether --enable-blkid_wiping was given.
if test "${enable_blkid_wiping+set}" = set; then :
enableval=$enable_blkid_wiping; BLKID_WIPING=$enableval
@@ -12232,9 +12230,8 @@ else
BLKID_WIPING=maybe
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BLKID_WIPING" >&5
-$as_echo "$BLKID_WIPING" >&6; }
+DEFAULT_USE_BLKID_WIPING=0
if test "$BLKID_WIPING" != no; then
pkg_config_init
@@ -12314,20 +12311,19 @@ else
BLKID_LIBS=$pkg_cv_BLKID_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- test "$BLKID_WIPING" = maybe && BLKID_WIPING=yes
-fi
- if test "$BLKID_WIPING" = yes; then
- BLKID_PC="blkid"
- DEFAULT_USE_BLKID_WIPING=1
+ BLKID_WIPING=yes
+ BLKID_PC="blkid"
+ DEFAULT_USE_BLKID_WIPING=1
$as_echo "#define BLKID_WIPING_SUPPORT 1" >>confdefs.h
- else
- DEFAULT_USE_BLKID_WIPING=0
- fi
-else
- DEFAULT_USE_BLKID_WIPING=0
+
fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable libblkid detection of signatures when wiping" >&5
+$as_echo_n "checking whether to enable libblkid detection of signatures when wiping... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BLKID_WIPING" >&5
+$as_echo "$BLKID_WIPING" >&6; }
cat >>confdefs.h <<_ACEOF
#define DEFAULT_USE_BLKID_WIPING $DEFAULT_USE_BLKID_WIPING
@@ -12335,8 +12331,6 @@ _ACEOF
################################################################################
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use udev-systemd protocol for jobs in background" >&5
-$as_echo_n "checking whether to use udev-systemd protocol for jobs in background... " >&6; }
# Check whether --enable-udev-systemd-background-jobs was given.
if test "${enable_udev_systemd_background_jobs+set}" = set; then :
enableval=$enable_udev_systemd_background_jobs; UDEV_SYSTEMD_BACKGROUND_JOBS=$enableval
@@ -12344,8 +12338,6 @@ else
UDEV_SYSTEMD_BACKGROUND_JOBS=maybe
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UDEV_SYSTEMD_BACKGROUND_JOBS" >&5
-$as_echo "$UDEV_SYSTEMD_BACKGROUND_JOBS" >&6; }
if test "$UDEV_SYSTEMD_BACKGROUND_JOBS" != no; then
pkg_config_init
@@ -12426,10 +12418,15 @@ else
SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- test "$UDEV_SYSTEMD_BACKGROUND_JOBS" = maybe && UDEV_SYSTEMD_BACKGROUND_JOBS=yes
+ UDEV_SYSTEMD_BACKGROUND_JOBS=yes
fi
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use udev-systemd protocol for jobs in background" >&5
+$as_echo_n "checking whether to use udev-systemd protocol for jobs in background... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UDEV_SYSTEMD_BACKGROUND_JOBS" >&5
+$as_echo "$UDEV_SYSTEMD_BACKGROUND_JOBS" >&6; }
+
################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable synchronisation with udev processing" >&5
$as_echo_n "checking whether to enable synchronisation with udev processing... " >&6; }
diff --git a/configure.in b/configure.in
index 2ff4f99..8603a12 100644
--- a/configure.in
+++ b/configure.in
@@ -1310,50 +1310,43 @@ fi
################################################################################
dnl -- Enable blkid wiping functionality
-AC_MSG_CHECKING(whether to enable libblkid detection of signatures when wiping)
AC_ARG_ENABLE(blkid_wiping,
AC_HELP_STRING([--disable-blkid_wiping],
[disable libblkid detection of signatures when wiping and use native code instead]),
BLKID_WIPING=$enableval, BLKID_WIPING=maybe)
-AC_MSG_RESULT($BLKID_WIPING)
+DEFAULT_USE_BLKID_WIPING=0
if test "$BLKID_WIPING" != no; then
pkg_config_init
PKG_CHECK_MODULES(BLKID, blkid >= 2.24,
- [test "$BLKID_WIPING" = maybe && BLKID_WIPING=yes],
- [if test "$BLKID_WIPING" = maybe; then
+ [ BLKID_WIPING=yes
+ BLKID_PC="blkid"
+ DEFAULT_USE_BLKID_WIPING=1
+ AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
+ ], [if test "$BLKID_WIPING" = maybe; then
BLKID_WIPING=no
else
AC_MSG_ERROR([bailing out... blkid library >= 2.24 is required])
fi])
- if test "$BLKID_WIPING" = yes; then
- BLKID_PC="blkid"
- DEFAULT_USE_BLKID_WIPING=1
- AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
- else
- DEFAULT_USE_BLKID_WIPING=0
- fi
-else
- DEFAULT_USE_BLKID_WIPING=0
fi
+AC_MSG_CHECKING([whether to enable libblkid detection of signatures when wiping])
+AC_MSG_RESULT($BLKID_WIPING)
AC_DEFINE_UNQUOTED(DEFAULT_USE_BLKID_WIPING, [$DEFAULT_USE_BLKID_WIPING],
[Use blkid wiping by default.])
################################################################################
dnl -- Enable udev-systemd protocol to instantiate a service for background jobs
dnl -- Requires systemd version 205 at least (including support for systemd-run)
-AC_MSG_CHECKING(whether to use udev-systemd protocol for jobs in background)
AC_ARG_ENABLE(udev-systemd-background-jobs,
AC_HELP_STRING([--disable-udev-systemd-background-jobs],
[disable udev-systemd protocol to instantiate a service for background job]),
UDEV_SYSTEMD_BACKGROUND_JOBS=$enableval,
UDEV_SYSTEMD_BACKGROUND_JOBS=maybe)
-AC_MSG_RESULT($UDEV_SYSTEMD_BACKGROUND_JOBS)
if test "$UDEV_SYSTEMD_BACKGROUND_JOBS" != no; then
pkg_config_init
PKG_CHECK_MODULES(SYSTEMD, systemd >= 205,
- [test "$UDEV_SYSTEMD_BACKGROUND_JOBS" = maybe && UDEV_SYSTEMD_BACKGROUND_JOBS=yes],
+ [UDEV_SYSTEMD_BACKGROUND_JOBS=yes],
[if test "$UDEV_SYSTEMD_BACKGROUND_JOBS" = maybe; then
UDEV_SYSTEMD_BACKGROUND_JOBS=no
else
@@ -1361,6 +1354,9 @@ if test "$UDEV_SYSTEMD_BACKGROUND_JOBS" != no; then
fi])
fi
+AC_MSG_CHECKING(whether to use udev-systemd protocol for jobs in background)
+AC_MSG_RESULT($UDEV_SYSTEMD_BACKGROUND_JOBS)
+
################################################################################
dnl -- Enable udev synchronisation
AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
6 years, 10 months
master - cache: lvcreate --cachepool checks for cache pool
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b3ef051e0637ac7f72a...
Commit: b3ef051e0637ac7f72ab245342e5a29394071c24
Parent: f91ea96b4f221894008d196c1f87b93527c51311
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 9 10:59:37 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 9 10:59:37 2017 +0200
cache: lvcreate --cachepool checks for cache pool
Code path missed validation of lvcreate --cachepool argument.
If the non cache-pool LV was passed in, code has still continued
further work and failed later on internal error. Validate this
condition at right place now.
---
WHATS_NEW | 1 +
test/shell/lvcreate-cache.sh | 6 ++++++
tools/lvcreate.c | 7 +++++++
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index fcf3148..cdd401e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.172 -
===============================
+ Improve lvcreate --cachepool arg validation.
Limit maximal size of thin-pool for specific chunk size.
Print a warning about in-use PVs with no VG using them.
Disable automatic clearing of PVs that look like in-use orphans.
diff --git a/test/shell/lvcreate-cache.sh b/test/shell/lvcreate-cache.sh
index faa78b2..410e105 100644
--- a/test/shell/lvcreate-cache.sh
+++ b/test/shell/lvcreate-cache.sh
@@ -26,6 +26,7 @@ aux prepare_vg 5 80000
aux lvmconf 'global/cache_disabled_features = [ "policy_smq" ]'
+
#######################
# Cache_Pool creation #
#######################
@@ -62,6 +63,11 @@ grep "No command with matching syntax recognised" err
# Check nothing has been created yet
check vg_field $vg lv_count 0
+# Checks that argument passed with --cachepool is really a cache-pool
+lvcreate -an -l 1 -n $lv1 $vg
+# Hint: nice way to 'tee' only stderr.log so we can check it's log_error()
+fail lvcreate -L10 --cachepool $vg/$lv1 2> >(tee -a stderr.log >&2)
+grep "not a cache pool" stderr.log
# With --type cache-pool we are clear which segtype has to be created
lvcreate -l 1 --type cache-pool $vg/pool1
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index e83c130..f464896 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -1193,6 +1193,13 @@ static int _determine_cache_argument(struct volume_group *vg,
lp->create_pool = 0;
lp->origin_name = NULL;
} else if (lv) {
+ if (arg_is_set(cmd, cachepool_ARG)) {
+ /* Argument of --cachepool has to be a cache-pool */
+ log_error("Logical volume %s is not a cache pool.",
+ display_lvname(lv));
+ return 0;
+ }
+
/* Origin exists, create cache pool volume */
if (!validate_lv_cache_create_origin(lv))
return_0;
6 years, 10 months
master - tests: fix compilation of unit tests
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f91ea96b4f221894008...
Commit: f91ea96b4f221894008d196c1f87b93527c51311
Parent: ee5ecde35eca656e85ee5c83b15ad4029d0acf4d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 6 15:38:45 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jun 8 11:59:02 2017 +0200
tests: fix compilation of unit tests
Rule for TARGET compiling got missing and needs to be explicitely
expressed, otherwise default unsuitable rule is applied.
---
test/unit/Makefile.in | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/test/unit/Makefile.in b/test/unit/Makefile.in
index 70b7e79..7aa180f 100644
--- a/test/unit/Makefile.in
+++ b/test/unit/Makefile.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2015 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2011-2017 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
#
@@ -24,15 +24,15 @@ UNITS = \
string_t.c\
run.c
-include $(top_builddir)/make.tmpl
-
-ifeq ($(MAKECMDGOALS),distclean)
+ifeq ("@TESTING@", "yes")
SOURCES = $(UNITS)
+TARGETS = run
endif
-ifeq ("$(TESTING)", "yes")
+include $(top_builddir)/make.tmpl
+
+ifeq ($(MAKECMDGOALS),distclean)
SOURCES = $(UNITS)
-TARGETS = run
endif
ifeq ("$(TESTING)", "yes")
@@ -42,6 +42,8 @@ CFLAGS += @CUNIT_CFLAGS@
check: unit
$(TARGETS): $(OBJECTS) $(top_builddir)/libdm/libdevmapper.$(LIB_SUFFIX)
+ $(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) -L$(top_builddir)/libdm \
+ -o $@ $(OBJECTS) $(LDLIBS)
unit: $(TARGETS)
@echo Running unit tests
6 years, 10 months