master - lvcreate: tollerate defaults
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c1ee6d4ffc7d52...
Commit: c1ee6d4ffc7d520e015a8e44f50392510fb85167
Parent: ed2a0560ad23f3de0b63e4c48ce91e6d5c744c23
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 31 13:37:39 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 3 14:19:32 2014 +0100
lvcreate: tollerate defaults
lvcreate -m0 and -Mn goes with anything.
Read ahead works either with pools or thin/cache, but not with both.
---
tools/lvcreate.c | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 6b8c4b5..b6768ba 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -653,7 +653,7 @@ static int _lvcreate_params(struct cmd_context *cmd,
segtype_str = "thin";
else if (arg_is_set(cmd, virtualsize_ARG)) {
if (arg_is_set(cmd, virtualoriginsize_ARG))
- segtype_str = "snapshot";
+ segtype_str = "snapshot"; /* --virtualoriginsize incompatible with pools */
else
segtype_str = find_config_tree_str(cmd, global_sparse_segtype_default_CFG, NULL);
} else if (arg_uint_value(cmd, mirrors_ARG, 0)) {
@@ -685,9 +685,12 @@ static int _lvcreate_params(struct cmd_context *cmd,
contiguous_ARG,\
ignoreactivationskip_ARG,\
ignoremonitoring_ARG,\
+ mirrors_ARG,\
name_ARG,\
noudevsync_ARG,\
permission_ARG,\
+ persistent_ARG,\
+ readahead_ARG,\
setactivationskip_ARG,\
test_ARG,\
type_ARG
@@ -701,14 +704,12 @@ static int _lvcreate_params(struct cmd_context *cmd,
mirrorlog_ARG
#define MIRROR_RAID_ARGS \
- mirrors_ARG,\
nosync_ARG,\
regionsize_ARG
#define PERSISTENT_ARGS \
major_ARG,\
- minor_ARG,\
- persistent_ARG
+ minor_ARG
#define POOL_ARGS \
pooldatasize_ARG,\
@@ -1210,13 +1211,6 @@ static int _check_thin_parameters(struct volume_group *vg, struct lvcreate_param
}
if (!seg_is_thin_volume(lp) && !lp->snapshot) {
- /* Not creating thin volume nor snapshot */
- if (arg_from_list_is_set(vg->cmd, "may only be given when creating a new thin Logical volume or snapshot",
- permission_ARG,
- persistent_ARG,
- readahead_ARG,
- -1))
- return_0;
if (!lp->create_pool) {
/* Not even creating thin pool? */
log_error("Please specify device size(s).");
@@ -1285,7 +1279,14 @@ static int _check_pool_parameters(struct cmd_context *cmd,
}
/* When creating just pool the pool_name needs to be in lv_name */
lp->lv_name = lp->pool_name;
+ } else if (vg) {
+ /* FIXME: what better to do with --readahead and pools? */
+ if (arg_is_set(cmd, readahead_ARG)) {
+ log_error("Ambigous --readahead parameter specified. Please use either with pool or volume.");
+ return 0;
+ }
}
+
return 1;
}
/* Not creating new pool, but existing pool is needed */
9 years, 1 month
master - libdm: init char array
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ed2a0560ad23f3...
Commit: ed2a0560ad23f3de0b63e4c48ce91e6d5c744c23
Parent: e09ee21fd46287ed245ea086ddcf06140a83431a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 31 13:04:46 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 3 14:19:31 2014 +0100
libdm: init char array
When non-root uses dm_check_version() it's been printing some unit
values from stack. So always init those vars.
---
WHATS_NEW_DM | 1 +
libdm/ioctl/libdm-iface.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 6981f8f..6b5ee3a 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.91 -
====================================
+ Don't print uninitialized stack bytes when non-root uses dm_check_version().
Fix selection criteria to not match reserved values when using >, <, >=, <.
Add DM_LIST_HEAD_INIT macro to libdevmapper.h
Fix dm_is_dm_major to not issue error about missing /proc lines for dm module.
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index c308fd2..4c37a53 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -544,7 +544,7 @@ static int _check_version(char *version, size_t size, int log_suppress)
*/
int dm_check_version(void)
{
- char libversion[64], dmversion[64];
+ char libversion[64] = "", dmversion[64] = "";
const char *compat = "";
if (_version_checked)
9 years, 1 month