master - tests: check prohibited names
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=87e559f1eca6e3...
Commit: 87e559f1eca6e3d2cc64d2b6401067ef2efa93ed
Parent: bfbf6b7c122bc1851834daeec8ade6e1becaf454
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 7 20:27:34 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 8 11:00:16 2014 +0200
tests: check prohibited names
---
test/shell/lvcreate-usage.sh | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvcreate-usage.sh b/test/shell/lvcreate-usage.sh
index 105fbce..2a0e0a6 100644
--- a/test/shell/lvcreate-usage.sh
+++ b/test/shell/lvcreate-usage.sh
@@ -150,3 +150,11 @@ lvcreate -L 32m -n $lv -i2 --stripesize 128k --readahead auto $vg
check lv_field $vg/$lv lv_read_ahead "auto"
check lv_field $vg/$lv lv_kernel_read_ahead "512.00k"
lvremove -ff $vg
+
+# prohibited names
+for i in pvmove snapshot ; do
+ invalid lvcreate -l1 -n ${i}1 $vg
+done
+for i in _cdata _cmeta _mimage _mlog _pmspare _tdata _tmeta _vorigin ; do
+ invalid lvcreate -l1 -n s_${i}_1 $vg
+done
10 years, 1 month
master - cleanup: libdm drop already zeroed elements
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bfbf6b7c122bc1...
Commit: bfbf6b7c122bc1851834daeec8ade6e1becaf454
Parent: a41ab41b704ace5a82efada9acd76965c6274078
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 7 21:37:58 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 8 11:00:16 2014 +0200
cleanup: libdm drop already zeroed elements
Drop zeroing of zalloc-ed memory.
---
libdm/libdm-deptree.c | 11 -----------
1 files changed, 0 insertions(+), 11 deletions(-)
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index 7c4da9b..0a53755 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -503,7 +503,6 @@ static struct dm_tree_node *_create_dm_tree_node(struct dm_tree *dtree,
node->info = *info;
node->context = context;
node->udev_flags = udev_flags;
- node->activation_priority = 0;
dm_list_init(&node->uses);
dm_list_init(&node->used_by);
@@ -1136,8 +1135,6 @@ struct dm_tree_node *dm_tree_add_new_dev_with_udev_flags(struct dm_tree *dtree,
dnode->props.major = major;
dnode->props.minor = minor;
- dnode->props.new_name = NULL;
- dnode->props.size_changed = 0;
} else if (strcmp(name, dnode->name)) {
/* Do we need to rename node? */
if (!(dnode->props.new_name = dm_pool_strdup(dtree->mem, name))) {
@@ -2813,15 +2810,7 @@ static struct load_segment *_add_segment(struct dm_tree_node *dnode, unsigned ty
seg->type = type;
seg->size = size;
- seg->area_count = 0;
dm_list_init(&seg->areas);
- seg->stripe_size = 0;
- seg->persistent = 0;
- seg->chunk_size = 0;
- seg->cow = NULL;
- seg->origin = NULL;
- seg->merge = NULL;
-
dm_list_add(&dnode->props.segs, &seg->list);
dnode->props.segment_count++;
10 years, 1 month
master - cleanup: reindent return
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a41ab41b704ace...
Commit: a41ab41b704ace5a82efada9acd76965c6274078
Parent: c1ae39e2ef9e4b31faf655f321ada0b4a3049426
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 4 21:45:37 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 8 11:00:16 2014 +0200
cleanup: reindent return
Since the return here is the only path, reindent for readability.
---
libdm/libdm-common.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index 5c8b49c..f404c63 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -1595,8 +1595,8 @@ int dm_set_sysfs_dir(const char *sysfs_dir)
_sysfs_dir[0] = '\0';
return 1;
}
- else
- return _canonicalize_and_set_dir(sysfs_dir, NULL, sizeof _sysfs_dir, _sysfs_dir);
+
+ return _canonicalize_and_set_dir(sysfs_dir, NULL, sizeof _sysfs_dir, _sysfs_dir);
}
const char *dm_sysfs_dir(void)
10 years, 1 month
master - cleanup: update comments
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c1ae39e2ef9e4b...
Commit: c1ae39e2ef9e4b31faf655f321ada0b4a3049426
Parent: d4d8060ff42ed25886eda71122513873a25a3f12
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 4 21:19:26 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 8 11:00:16 2014 +0200
cleanup: update comments
Fix cut&paste comments
---
lib/mm/memlock.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
index c08b0eb..e626a6a 100644
--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
@@ -93,8 +93,8 @@ static const char * const _blacklist_maps[] = {
"/LC_MESSAGES/",
"gconv/gconv-modules.cache",
"/libreadline.so.", /* not using readline during mlock */
- "/libncurses.so.", /* not using readline during mlock */
- "/libtinfo.so.", /* not using readline during mlock */
+ "/libncurses.so.", /* not using ncurses during mlock */
+ "/libtinfo.so.", /* not using tinfo during mlock */
"/libdl-", /* not using dlopen,dlsym during mlock */
/* "/libdevmapper-event.so" */
};
10 years, 1 month
master - cleanup: do include lvm headers in libdm build
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d4d8060ff42ed2...
Commit: d4d8060ff42ed25886eda71122513873a25a3f12
Parent: 5553a099d1a6f0c8e3421712517d41ef820a5964
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 4 21:13:29 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 8 11:00:15 2014 +0200
cleanup: do include lvm headers in libdm build
Relocate some defines from lvm headers to those
few shared between libdm and lib code.
---
lib/datastruct/lvm-types.h | 5 -----
lib/misc/lib.h | 11 ++++++++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/datastruct/lvm-types.h b/lib/datastruct/lvm-types.h
index e96009d..de144bd 100644
--- a/lib/datastruct/lvm-types.h
+++ b/lib/datastruct/lvm-types.h
@@ -21,11 +21,6 @@
#include "libdevmapper.h"
-/* Define some portable printing types */
-#define PRIsize_t "zu"
-#define PRIptrdiff_t "td"
-#define PRIpid_t PRId32
-
struct str_list {
struct dm_list list;
const char *str;
diff --git a/lib/misc/lib.h b/lib/misc/lib.h
index 100827d..f0dba25 100644
--- a/lib/misc/lib.h
+++ b/lib/misc/lib.h
@@ -25,17 +25,22 @@
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
+/* Define some portable printing types */
+#define PRIsize_t "zu"
+#define PRIptrdiff_t "td"
+#define PRIpid_t PRId32
+
#include "intl.h"
#include "libdevmapper.h"
-#include "lvm-globals.h"
-#include "lvm-wrappers.h"
-#include "lvm-types.h"
#include "util.h"
#ifdef DM
# include "dm-logging.h"
#else
# include "lvm-logging.h"
+# include "lvm-globals.h"
+# include "lvm-wrappers.h"
+# include "lvm-types.h"
#endif
#include <errno.h>
10 years, 1 month
master - cleanup: use DM_ARRAY_SIZE
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5553a099d1a6f0...
Commit: 5553a099d1a6f0c8e3421712517d41ef820a5964
Parent: 56175f6ba96d161a1d8f70bf985d95066b41d2d9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 4 21:10:30 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 8 11:00:15 2014 +0200
cleanup: use DM_ARRAY_SIZE
More use of libdevmapper macro
---
daemons/dmeventd/dmeventd.c | 2 +-
lib/display/display.c | 2 +-
lib/metadata/metadata.c | 2 +-
lib/mm/memlock.c | 4 ++--
lib/raid/raid.c | 2 +-
lib/thin/thin.c | 8 ++++----
libdm/ioctl/libdm-iface.c | 3 +--
tools/lvcreate.c | 2 +-
unit-tests/datastruct/bitset_t.c | 2 +-
9 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index f4f09b8..af7a2e4 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -1479,7 +1479,7 @@ static int _handle_request(struct dm_event_daemon_message *msg,
{ DM_EVENT_CMD_GET_PARAMETERS, _get_parameters},
}, *req;
- for (req = requests; req < requests + sizeof(requests) / sizeof(struct request); req++)
+ for (req = requests; req < requests + DM_ARRAY_SIZE(requests); ++req)
if (req->cmd == msg->cmd)
return req->f(message_data);
diff --git a/lib/display/display.c b/lib/display/display.c
index 1846f90..810097a 100644
--- a/lib/display/display.c
+++ b/lib/display/display.c
@@ -41,7 +41,7 @@ static const struct {
ALLOC_INHERIT, "inherit", 'i'}
};
-static const int _num_policies = sizeof(_policies) / sizeof(*_policies);
+static const int _num_policies = DM_ARRAY_SIZE(_policies);
/* Test if the doubles are close enough to be considered equal */
static int _close_enough(double d1, double d2)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 65a288c..643613f 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -2027,7 +2027,7 @@ static int _lv_each_dependency(struct logical_volume *lv,
(lv->rdevice && lv != lv->rdevice->slog) ? lv->rdevice->slog : 0,
lv->snapshot ? lv->snapshot->origin : 0,
lv->snapshot ? lv->snapshot->cow : 0 };
- for (i = 0; i < sizeof(deps) / sizeof(*deps); ++i) {
+ for (i = 0; i < DM_ARRAY_SIZE(deps); ++i) {
if (deps[i] && !fn(deps[i], data))
return_0;
}
diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
index 70af07e..c08b0eb 100644
--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
@@ -176,7 +176,7 @@ static int _maps_line(const struct dm_config_node *cn, lvmlock_t lock,
}
/* always ignored areas */
- for (i = 0; i < sizeof(_ignore_maps) / sizeof(_ignore_maps[0]); ++i)
+ for (i = 0; i < DM_ARRAY_SIZE(_ignore_maps); ++i)
if (strstr(line + pos, _ignore_maps[i])) {
log_debug_mem("%s ignore filter '%s' matches '%s': Skipping.",
lock_str, _ignore_maps[i], line);
@@ -186,7 +186,7 @@ static int _maps_line(const struct dm_config_node *cn, lvmlock_t lock,
sz = to - from;
if (!cn) {
/* If no blacklist configured, use an internal set */
- for (i = 0; i < sizeof(_blacklist_maps) / sizeof(_blacklist_maps[0]); ++i)
+ for (i = 0; i < DM_ARRAY_SIZE(_blacklist_maps); ++i)
if (strstr(line + pos, _blacklist_maps[i])) {
log_debug_mem("%s default filter '%s' matches '%s': Skipping.",
lock_str, _blacklist_maps[i], line);
diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index e592573..0869ff4 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -352,7 +352,7 @@ static int _raid_target_present(struct cmd_context *cmd,
return 0;
}
- for (i = 0; i < sizeof(_features)/sizeof(*_features); i++)
+ for (i = 0; i < DM_ARRAY_SIZE(_features); ++i)
if ((maj > _features[i].maj) ||
(maj == _features[i].maj && min >= _features[i].min))
_raid_attrs |= _features[i].raid_feature;
diff --git a/lib/thin/thin.c b/lib/thin/thin.c
index ff4eafd..d4bde8b 100644
--- a/lib/thin/thin.c
+++ b/lib/thin/thin.c
@@ -653,7 +653,7 @@ static int _thin_target_present(struct cmd_context *cmd,
return 0;
}
- for (i = 0; i < sizeof(_features)/sizeof(*_features); i++)
+ for (i = 0; i < DM_ARRAY_SIZE(_features); ++i)
if ((maj > _features[i].maj) ||
(maj == _features[i].maj && min >= _features[i].min))
_attrs |= _features[i].thin_feature;
@@ -678,13 +678,13 @@ static int _thin_target_present(struct cmd_context *cmd,
str = cv->v.str;
if (!*str)
continue;
- for (i = 0; i < sizeof(_features)/sizeof(*_features); i++)
+ for (i = 0; i < DM_ARRAY_SIZE(_features); ++i)
if (strcasecmp(str, _features[i].feature) == 0)
_feature_mask |= _features[i].thin_feature;
}
}
_feature_mask = ~_feature_mask;
- for (i = 0; i < sizeof(_features)/sizeof(*_features); i++)
+ for (i = 0; i < DM_ARRAY_SIZE(_features); ++i)
if ((_attrs & _features[i].thin_feature) &&
!(_feature_mask & _features[i].thin_feature))
log_very_verbose("Target %s %s support disabled by %s",
@@ -757,7 +757,7 @@ int init_multiple_segtypes(struct cmd_context *cmd, struct segtype_library *segl
struct segment_type *segtype;
unsigned i;
- for (i = 0; i < sizeof(reg_segtypes)/sizeof(reg_segtypes[0]); ++i) {
+ for (i = 0; i < DM_ARRAY_SIZE(reg_segtypes); ++i) {
segtype = dm_zalloc(sizeof(*segtype));
if (!segtype) {
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index 25f1d90..73cda17 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -1822,8 +1822,7 @@ int dm_task_run(struct dm_task *dmt)
const char *dev_name = DEV_NAME(dmt);
const char *dev_uuid = DEV_UUID(dmt);
- if ((unsigned) dmt->type >=
- (sizeof(_cmd_data_v4) / sizeof(*_cmd_data_v4))) {
+ if ((unsigned) dmt->type >= DM_ARRAY_SIZE(_cmd_data_v4)) {
log_error(INTERNAL_ERROR "unknown device-mapper task %d",
dmt->type);
return 0;
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index c612465..6a9264a 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -1135,7 +1135,7 @@ static int _check_thin_parameters(struct volume_group *vg, struct lvcreate_param
zero_ARG
};
- for (i = 0; i < sizeof(_argname)/sizeof(_argname[0]); ++i) {
+ for (i = 0; i < DM_ARRAY_SIZE(_argname); ++i) {
if (arg_count(vg->cmd, _argname[i])) {
log_error("%s is only available for thin pool creation.",
arg_long_option_name(_argname[i]));
diff --git a/unit-tests/datastruct/bitset_t.c b/unit-tests/datastruct/bitset_t.c
index 83b297b..93deb5a 100644
--- a/unit-tests/datastruct/bitset_t.c
+++ b/unit-tests/datastruct/bitset_t.c
@@ -121,7 +121,7 @@ int main(int argc, char **argv)
};
int i;
- for (i = 0; i < sizeof(tests) / sizeof(*tests); i++) {
+ for (i = 0; i < DM_ARRAY_SIZE(tests); ++i) {
struct dm_pool *mem = dm_pool_create("bitset test", 1024);
assert(mem);
tests[i](mem);
10 years, 1 month
master - cleanup: refactor apply_lvname_restrictions
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=56175f6ba96d16...
Commit: 56175f6ba96d161a1d8f70bf985d95066b41d2d9
Parent: 9eab84aa2b4cf97f931f0291b3f690cdceaa1e75
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 7 20:19:14 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 8 11:00:15 2014 +0200
cleanup: refactor apply_lvname_restrictions
Split apply_lvname_restrictions into 2 internal
function:
_lvname_has_reserved_prefix()
_lvname_has_reserved_string()
---
lib/misc/lvm-string.c | 65 ++++++++++++++++++++++++++++---------------------
1 files changed, 37 insertions(+), 28 deletions(-)
diff --git a/lib/misc/lvm-string.c b/lib/misc/lvm-string.c
index a74fd58..5377528 100644
--- a/lib/misc/lvm-string.c
+++ b/lib/misc/lvm-string.c
@@ -100,45 +100,59 @@ int validate_name(const char *n)
return (_validate_name(n) < 0 ? 0 : 1);
}
-int apply_lvname_restrictions(const char *name)
+static const char *_lvname_has_reserved_prefix(const char *lvname)
{
- static const char * const _reserved_prefixes[] = {
- "snapshot",
+ static const char _prefixes[][12] = {
"pvmove",
- NULL
+ "snapshot"
};
+ unsigned i;
+
+ for (i = 0; i < DM_ARRAY_SIZE(_prefixes); ++i)
+ if (!strncmp(lvname, _prefixes[i], strlen(_prefixes[i])))
+ return _prefixes[i];
- static const char * const _reserved_strings[] = {
+ return NULL;
+}
+
+static const char *_lvname_has_reserved_string(const char *lvname)
+{
+ static const char _strings[][12] = {
"_cdata",
"_cmeta",
- "_mlog",
"_mimage",
+ "_mlog",
"_pmspare",
"_rimage",
"_rmeta",
- "_vorigin",
"_tdata",
"_tmeta",
- NULL
+ "_vorigin"
};
-
unsigned i;
+
+ for (i = 0; i < DM_ARRAY_SIZE(_strings); ++i)
+ if (strstr(lvname, _strings[i]))
+ return _strings[i];
+
+ return NULL;
+}
+
+
+int apply_lvname_restrictions(const char *name)
+{
const char *s;
- for (i = 0; (s = _reserved_prefixes[i]); i++) {
- if (!strncmp(name, s, strlen(s))) {
- log_error("Names starting \"%s\" are reserved. "
- "Please choose a different LV name.", s);
- return 0;
- }
+ if ((s = _lvname_has_reserved_prefix(name))) {
+ log_error("Names starting \"%s\" are reserved. "
+ "Please choose a different LV name.", s);
+ return 0;
}
- for (i = 0; (s = _reserved_strings[i]); i++) {
- if (strstr(name, s)) {
- log_error("Names including \"%s\" are reserved. "
- "Please choose a different LV name.", s);
- return 0;
- }
+ if ((s = _lvname_has_reserved_string(name))) {
+ log_error("Names including \"%s\" are reserved. "
+ "Please choose a different LV name.", s);
+ return 0;
}
return 1;
@@ -154,13 +168,8 @@ name_error_t validate_name_detailed(const char *name)
int is_reserved_lvname(const char *name)
{
- int rc, old_suppress;
-
- old_suppress = log_suppress(2);
- rc = !apply_lvname_restrictions(name);
- log_suppress(old_suppress);
-
- return rc;
+ return (_lvname_has_reserved_prefix(name) ||
+ _lvname_has_reserved_string(name)) ? 1 : 0;
}
char *build_dm_uuid(struct dm_pool *mem, const struct logical_volume *lv,
10 years, 1 month
master - debug: catch invalid request for tree
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9eab84aa2b4cf9...
Commit: 9eab84aa2b4cf97f931f0291b3f690cdceaa1e75
Parent: 43f849296e1e4b5450681e275495450bf041a11b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 7 20:33:50 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 8 11:00:15 2014 +0200
debug: catch invalid request for tree
In general for non-toplevel LVs we shouldn't allow any _tree_action.
For now error on request for cache_pool activation which
doesn't even exist in dm-table.
---
lib/activate/dev_manager.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index cde39af..fb9625d 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -2786,6 +2786,12 @@ static int _tree_action(struct dev_manager *dm, struct logical_volume *lv,
char *dlid;
int r = 0;
+ /* Some LV can be used for top level tree */
+ /* TODO: add more.... */
+ if (lv_is_cache_pool(lv)) {
+ log_error(INTERNAL_ERROR "Cannot create tree for %s.", lv->name);
+ return 0;
+ }
/* Some targets may build bigger tree for activation */
dm->activation = ((action == PRELOAD) || (action == ACTIVATE));
if (!(dtree = _create_partial_dtree(dm, lv, laopts->origin_only)))
10 years, 1 month
master - lvconvert: do not activate cache pool
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=43f849296e1e4b...
Commit: 43f849296e1e4b5450681e275495450bf041a11b
Parent: db4cf3010640307d1764cebf2c7497676d209383
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 7 23:52:22 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 8 11:00:14 2014 +0200
lvconvert: do not activate cache pool
Cache pool cannot be active alone.
---
tools/lvconvert.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 1331620..94d870a 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2698,8 +2698,11 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
return 0;
}
- /* Allow to have only thinpool active and restore it's active state */
- activate_pool = lv_is_active(pool_lv);
+ if (segtype_is_cache_pool(lp->segtype))
+ activate_pool = 0; /* Cannot activate cache pool */
+ else
+ /* Allow to have only thinpool active and restore it's active state */
+ activate_pool = lv_is_active(pool_lv);
/* We are changing target type, so deactivate first */
if (!deactivate_lv(cmd, pool_lv)) {
10 years, 1 month
master - man: cleanup new params
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=db4cf301064030...
Commit: db4cf3010640307d1764cebf2c7497676d209383
Parent: 2868d897da186d0f65856936543e25bcd5057440
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 7 22:20:27 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Apr 8 11:00:14 2014 +0200
man: cleanup new params
Correcting cachemode args
---
man/lvcreate.8.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index 445af80..4e7612a 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -150,7 +150,7 @@ Controls whether Logical Volumes are persistently flagged to be skipped during
activation. By default, thin snapshot volumes are flagged for activation skip.
To activate such volumes, an extra \fB\-K/\-\-ignoreactivationskip\fP option must
be used. The flag is not applied during deactivation.
-Use \fBlvchange \-k/\-\-setactivationskip {y | n}\fP command to attach or
+Use \fBlvchange \-k/\-\-setactivationskip {y|n}\fP command to attach or
detach the flag for existing volumes. To see whether the flag is attached,
use \fBlvs\fP command where the state of the flag is reported within
\fBlv_attr\fP bits.
@@ -159,7 +159,7 @@ use \fBlvs\fP command where the state of the flag is reported within
Ignore the flag to skip Logical Volumes during activation.
.TP
-.IR \fB\-\-cachemode " " { writeback | writethrough }
+.IR \fB\-\-cachemode " {" writeback | writethrough }
Specifying a cache mode determines when the writes to a cache LV
are considered complete. When \fIwriteback\fP is specified, a write is
considered complete as soon as it is stored in the cache pool LV.
10 years, 1 month