master - raid: more coverity issues
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=980e4f673eb9189f9fe...
Commit: 980e4f673eb9189f9fe2dd5844a56f107d078f40
Parent: c34ab29ec6c3e737b65a1b589ef4091944a5127d
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Thu Mar 30 18:39:04 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Thu Mar 30 18:39:04 2017 +0200
raid: more coverity issues
---
lib/metadata/raid_manip.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 8e5b1a8..63a2a6c 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -751,6 +751,11 @@ static int _reorder_raid10_near_seg_areas(struct lv_segment *seg, enum raid0_rai
uint32_t *idx, stripes = seg->area_count;
unsigned i = 0;
+ if (!stripes) {
+ log_error(INTERNAL_ERROR "stripes may not be 0.");
+ return 0;
+ }
+
/* Internal sanity checks... */
if (!(conv == reorder_to_raid10_near || conv == reorder_from_raid10_near))
return_0;
@@ -2082,7 +2087,7 @@ static int _activate_sub_lvs_excl_local(struct logical_volume *lv, uint32_t star
display_lvname(lv));
for (s = start_idx; s < seg->area_count; s++)
if (!_activate_sub_lv_excl_local(seg_lv(seg, s)) ||
- !_activate_sub_lv_excl_local(seg_metalv(seg, s)))
+ (seg->meta_areas && !_activate_sub_lv_excl_local(seg_metalv(seg, s))))
return 0;
return 1;
@@ -4598,7 +4603,7 @@ static int _clear_meta_lvs(struct logical_volume *lv)
struct lv_segment_area *tmp_areas;
const struct segment_type *tmp_segtype;
struct dm_list meta_lvs;
- struct lv_list *lvl_array, *lvl;
+ struct lv_list *lvl;
int is_raid45n10 = seg_is_raid4(seg) || seg_is_raid5_n(seg) || seg_is_raid10(seg);
/* Reject non-raid0_meta/raid4/raid5_n segment types cautiously */
@@ -4606,9 +4611,6 @@ static int _clear_meta_lvs(struct logical_volume *lv)
(!seg_is_raid0_meta(seg) && !is_raid45n10))
return_0;
- if (!(lvl_array = dm_pool_alloc(lv->vg->vgmem, seg->area_count * sizeof(*lvl_array))))
- return_0;
-
dm_list_init(&meta_lvs);
tmp_segtype = seg->segtype;
tmp_areas = seg->meta_areas;
@@ -5894,7 +5896,7 @@ int lv_raid_convert(struct logical_volume *lv,
struct lv_segment *seg = first_seg(lv);
uint32_t stripes = new_stripes, stripe_size;
uint32_t new_image_count = seg->area_count;
- uint32_t region_size = new_region_size;
+ uint32_t region_size;
uint32_t data_copies = seg->data_copies;
uint32_t available_slvs, removed_slvs;
takeover_fn_t takeover_fn;
7 years, 1 month
master - raid: favour dm_list_first()
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c34ab29ec6c3e737b65...
Commit: c34ab29ec6c3e737b65a1b589ef4091944a5127d
Parent: 2d75ef3b057fac5df66dee97b1cf93a582258582
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Thu Mar 30 18:13:27 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Thu Mar 30 18:13:27 2017 +0200
raid: favour dm_list_first()
---
lib/metadata/raid_manip.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index ed0f4c1..8e5b1a8 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -3091,8 +3091,7 @@ int lv_raid_split(struct logical_volume *lv, int yes, const char *split_name,
}
/* Get first item */
- dm_list_iterate_items(lvl, &data_list)
- break;
+ lvl = (struct lv_list *) dm_list_first(&data_list);
lvl->lv->name = split_name;
7 years, 1 month
master - raid: address coverity issues
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2d75ef3b057fac5df66...
Commit: 2d75ef3b057fac5df66dee97b1cf93a582258582
Parent: b3854155d9331868a92324b4ac6f03d04dd59baa
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Thu Mar 30 18:09:06 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Thu Mar 30 18:09:06 2017 +0200
raid: address coverity issues
---
lib/metadata/raid_manip.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 4d20639..ed0f4c1 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -937,11 +937,12 @@ static int _shift_and_rename_image_components(struct lv_segment *seg)
static char *_generate_raid_name(struct logical_volume *lv,
const char *suffix, int count)
{
- const char *format = (count >= 0) ? "%s_%s_%u" : "%s_%s";
char name[NAME_LEN], *lvname;
int historical;
- if (dm_snprintf(name, sizeof(name), format, lv->name, suffix, count) < 0) {
+ if (dm_snprintf(name, sizeof(name),
+ (count >= 0) ? "%s_%s_%u" : "%s_%s",
+ lv->name, suffix, count) < 0) {
log_error("Failed to new raid name for %s.",
display_lvname(lv));
return NULL;
@@ -1701,7 +1702,7 @@ static int _reshape_adjust_to_size(struct logical_volume *lv,
/* Externally visible LV size w/o reshape space */
lv->le_count = seg->len = new_le_count;
- lv->size = (uint64_t) (lv->le_count - new_image_count * _reshape_len_per_dev(seg)) * lv->vg->extent_size;
+ lv->size = (uint64_t) (lv->le_count - new_image_count * (uint32_t) _reshape_len_per_dev(seg)) * lv->vg->extent_size;
/* seg->area_len does not change */
if (old_image_count < new_image_count) {
7 years, 1 month
master - man-generator: add '.' to all messages
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b3854155d9331868a92...
Commit: b3854155d9331868a92324b4ac6f03d04dd59baa
Parent: 99dc49c7dda2244000eaa3b91b129923c8ed26e8
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Thu Mar 30 17:54:36 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Thu Mar 30 17:54:36 2017 +0200
man-generator: add '.' to all messages
---
tools/command.c | 42 +++++++++++++++++++++---------------------
1 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/tools/command.c b/tools/command.c
index 9a80812..0eecb24 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -425,7 +425,7 @@ static int lvp_name_to_enum(struct command *cmd, char *str)
return lv_props[i].lvp_enum;
}
- log_error("Parsing command defs: unknown lv property %s", str);
+ log_error("Parsing command defs: unknown lv property %s.", str);
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return LVP_NONE;
}
@@ -441,7 +441,7 @@ static int lvt_name_to_enum(struct command *cmd, char *str)
return lv_types[i].lvt_enum;
}
- log_error("Parsing command defs: unknown lv type %s", str);
+ log_error("Parsing command defs: unknown lv type %s.", str);
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return LVT_NONE;
}
@@ -522,7 +522,7 @@ static int is_opt_name(char *str)
return 1;
if ((str[0] == '-') && (str[1] != '-'))
- log_error("Parsing command defs: options must be specified in long form: %s", str);
+ log_error("Parsing command defs: options must be specified in long form: %s.", str);
return 0;
}
@@ -624,7 +624,7 @@ static void set_pos_def(struct command *cmd, char *str, struct arg_def *def)
val_enum = val_str_to_num(name);
if (!val_enum) {
- log_error("Parsing command defs: unknown pos arg: %s", name);
+ log_error("Parsing command defs: unknown pos arg: %s.", name);
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
}
@@ -673,7 +673,7 @@ static void set_opt_def(struct command *cmd, char *str, struct arg_def *def)
val_enum = conststr_VAL;
else {
- log_error("Parsing command defs: unknown opt arg: %s", name);
+ log_error("Parsing command defs: unknown opt arg: %s.", name);
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
}
@@ -725,7 +725,7 @@ static void add_oo_definition_line(const char *name, const char *line)
if ((colon = strchr(oo->name, ':')))
*colon = '\0';
else {
- log_error("Parsing command defs: invalid OO definition");
+ log_error("Parsing command defs: invalid OO definition.");
return;
}
@@ -750,7 +750,7 @@ static void append_oo_definition_line(const char *new_line)
len = strlen(old_line) + strlen(new_line) + 2;
line = dm_malloc(len);
if (!line) {
- log_error("Parsing command defs: no memory");
+ log_error("Parsing command defs: no memory.");
return;
}
@@ -797,7 +797,7 @@ static void include_optional_opt_args(struct command *cmd, const char *str)
int line_argc;
if (!(oo_line = get_oo_line(str))) {
- log_error("Parsing command defs: no OO line found for %s", str);
+ log_error("Parsing command defs: no OO line found for %s.", str);
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
}
@@ -940,7 +940,7 @@ static void update_prev_pos_arg(struct command *cmd, char *str, int required)
if (!strcmp(str, "..."))
def->flags |= ARG_DEF_FLAG_MAY_REPEAT;
else {
- log_error("Parsing command defs: unknown pos arg: %s", str);
+ log_error("Parsing command defs: unknown pos arg: %s.", str);
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
}
@@ -967,7 +967,7 @@ static void add_optional_opt_line(struct command *cmd, int argc, char *argv[])
else if (takes_arg)
update_prev_opt_arg(cmd, argv[i], OPTIONAL);
else {
- log_error("Parsing command defs: can't parse argc %d argv %s prev %s",
+ log_error("Parsing command defs: can't parse argc %d argv %s prev %s.",
i, argv[i], argv[i-1]);
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
@@ -993,7 +993,7 @@ static void add_ignore_opt_line(struct command *cmd, int argc, char *argv[])
else if (takes_arg)
update_prev_opt_arg(cmd, argv[i], IGNORE);
else {
- log_error("Parsing command defs: can't parse argc %d argv %s prev %s",
+ log_error("Parsing command defs: can't parse argc %d argv %s prev %s.",
i, argv[i], argv[i-1]);
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
@@ -1028,7 +1028,7 @@ static void add_required_opt_line(struct command *cmd, int argc, char *argv[])
else if (takes_arg)
update_prev_opt_arg(cmd, argv[i], REQUIRED);
else {
- log_error("Parsing command defs: can't parse argc %d argv %s prev %s",
+ log_error("Parsing command defs: can't parse argc %d argv %s prev %s.",
i, argv[i], argv[i-1]);
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
@@ -1053,7 +1053,7 @@ static void include_required_opt_args(struct command *cmd, char *str)
int line_argc;
if (!(oo_line = get_oo_line(str))) {
- log_error("Parsing command defs: no OO line found for %s", str);
+ log_error("Parsing command defs: no OO line found for %s.", str);
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
}
@@ -1107,7 +1107,7 @@ static void add_required_line(struct command *cmd, int argc, char *argv[])
/* set property for previous required_pos_arg */
update_prev_pos_arg(cmd, argv[i], REQUIRED);
} else {
- log_error("Parsing command defs: can't parse argc %d argv %s prev %s",
+ log_error("Parsing command defs: can't parse argc %d argv %s prev %s.",
i, argv[i], argv[i-1]);
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
@@ -1135,7 +1135,7 @@ static void add_rule(struct command *cmd, char *line)
int check = 0;
if (cmd->rule_count == CMD_MAX_RULES) {
- log_error("Parsing command defs: too many rules for cmd");
+ log_error("Parsing command defs: too many rules for cmd.");
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
}
@@ -1165,7 +1165,7 @@ static void add_rule(struct command *cmd, char *line)
else if (!strncmp(arg, "--", 2)) {
if (!rule->opts) {
if (!(rule->opts = dm_malloc(MAX_RULE_OPTS * sizeof(int)))) {
- log_error("Parsing command defs: no mem");
+ log_error("Parsing command defs: no mem.");
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
}
@@ -1174,7 +1174,7 @@ static void add_rule(struct command *cmd, char *line)
if (!rule->check_opts) {
if (!(rule->check_opts = dm_malloc(MAX_RULE_OPTS * sizeof(int)))) {
- log_error("Parsing command defs: no mem");
+ log_error("Parsing command defs: no mem.");
cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
}
@@ -1509,7 +1509,7 @@ int define_commands(const char *run_name)
}
if (!skip)
- log_error("Parsing command defs: can't process input line %s", line_orig);
+ log_error("Parsing command defs: can't process input line %s.", line_orig);
}
for (i = 0; i < COMMAND_COUNT; i++) {
@@ -2857,7 +2857,7 @@ static void _print_man_option_desc(struct command_name *cname, int opt_enum)
buf[bi++] = desc[di];
if (bi == DESC_LINE) {
- log_error("Parsing command defs: print_man_option_desc line too long");
+ log_error("Parsing command defs: print_man_option_desc line too long.");
exit(EXIT_FAILURE);
}
@@ -3433,14 +3433,14 @@ int main(int argc, char *argv[])
}
if (!primary && !secondary) {
- log_error("Usage: %s --primary|--secondary <command> [/path/to/description-file]", argv[0]);
+ log_error("Usage: %s --primary|--secondary <command> [/path/to/description-file].", argv[0]);
exit(EXIT_FAILURE);
}
if (optind < argc)
cmdname = strdup(argv[optind++]);
else {
- log_error("Missing command name");
+ log_error("Missing command name.");
exit(EXIT_FAILURE);
}
7 years, 1 month
master - man: add minor regexp
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=99dc49c7dda2244000e...
Commit: 99dc49c7dda2244000eaa3b91b129923c8ed26e8
Parent: 2b46fe5843401abff4004a1629152ed1de68fbd9
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Thu Mar 30 17:54:02 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Thu Mar 30 17:54:02 2017 +0200
man: add minor regexp
---
man/Makefile.in | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/Makefile.in b/man/Makefile.in
index a391e90..defa9b3 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -191,11 +191,10 @@ endef
#
# - multiple (>= 2)
# - in ' -'
-# - in (cache|thin)-*
# - in ranges
-# - in "$vg-$lv"
-# - in middle of options (e.g. '--use-policies')
+# - in middle of options (e.g. '--use-policies') and their arguments
# - in symbolic use (e.g. '->')
+# - in "$vg-$lv"
# - in single one in '\\f.-'
define ESCAPEHYPHENS
$(SED) -i -e "s+\([ [:alpha:]]\)-\{7\}+\1\\\-\\\-\\\-\\\-\\\-\\\-\\\-+g" \
@@ -207,6 +206,7 @@ $(SED) -i -e "s+\([ [:alpha:]]\)-\{7\}+\1\\\-\\\-\\\-\\\-\\\-\\\-\\\-+g" \
-e "s+\([^\]\)-\([[:alnum:]\?]\)+\1\\\-\2+g" \
-e "s+ --+\\\-\\\-+g" \
-e "s+|-|+|\\\-|+g" \
+ -e "s+|-\\\-+\\\-\\\-+g" \
-e "s+ -\"+ \\\-\"+g" \
-e "s+'--'+'\\\-\\\-'+g" \
-e "s+^--+\\\-\\\-+g" \
7 years, 1 month
master - dmsetup: replace (f)printf("\n") with putchar/putc
by Bryn Reeves
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2b46fe5843401abff40...
Commit: 2b46fe5843401abff4004a1629152ed1de68fbd9
Parent: febda60f3daf8d9e0ff47aa692a90fe4ed36c128
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Thu Mar 30 16:30:50 2017 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Thu Mar 30 16:30:50 2017 +0100
dmsetup: replace (f)printf("\n") with putchar/putc
---
tools/dmsetup.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 44ea6f9..5c5c14c 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -978,7 +978,7 @@ static void _display_info_long(struct dm_task *dmt, struct dm_info *info)
if ((uuid = dm_task_get_uuid(dmt)) && *uuid)
printf("UUID: %s\n", uuid);
- printf("\n");
+ putchar('\n');
}
static int _display_info(struct dm_task *dmt)
@@ -1612,7 +1612,7 @@ static char _yes_no_prompt(const char *prompt, ...)
} while (!ret || c != '\n');
if (c != '\n')
- printf("\n");
+ putchar('\n');
return ret;
}
@@ -2213,13 +2213,13 @@ static int _status(CMD_ARGS)
printf(FMTu64 " " FMTu64 " %s %s",
start, length, target_type, params);
}
- printf("\n");
+ putchar('\n');
}
matched = 1;
} while (next);
if (multiple_devices && _switches[VERBOSE_ARG] && matched && !ls_only)
- printf("\n");
+ putchar('\n');
if (matched && _switches[EXEC_ARG] && _command_to_exec && !_exec_command(name))
goto_out;
@@ -2374,10 +2374,10 @@ static int _deps(CMD_ARGS)
else
printf(" (%d, %d)", major, minor);
}
- printf("\n");
+ putchar('\n');
if (multiple_devices && _switches[VERBOSE_ARG])
- printf("\n");
+ putchar('\n');
r = 1;
@@ -5950,7 +5950,7 @@ static void _stats_usage(FILE *out)
fprintf(out, "\n<device> may be device name or (if only one) -u <uuid> or -j <major> -m <minor>\n");
fprintf(out, "<fields> are comma-separated. Use 'help -c' for list.\n");
- fprintf(out, "\n");
+ putc('\n', out);
}
static void _dmsetup_usage(FILE *out)
@@ -5981,7 +5981,7 @@ static void _dmsetup_usage(FILE *out)
fprintf(out, "Options are: devno, devname, blkdevname.\n");
fprintf(out, "Tree specific options are: ascii, utf, vt100; compact, inverted, notrunc;\n"
" blkdevname, [no]device, active, open, rw and uuid.\n");
- fprintf(out, "\n");
+ putc('\n', out);
}
static void _losetup_usage(FILE *out)
@@ -7079,7 +7079,7 @@ doit:
dm_report_output(_report);
if (_count > 1 && r) {
- printf("\n");
+ putchar('\n');
fflush(stdout);
/* wait for --interval and update timestamps */
if (!_do_report_wait()) {
7 years, 1 month
master - libdm: use correct FMTu32 format specifier for uint32_t
by Bryn Reeves
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=febda60f3daf8d9e0ff...
Commit: febda60f3daf8d9e0ff47aa692a90fe4ed36c128
Parent: e8d5e05ff57a327053f140f2fed4c12f8fe7e076
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Thu Mar 30 16:17:19 2017 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Thu Mar 30 16:17:19 2017 +0100
libdm: use correct FMTu32 format specifier for uint32_t
---
libdm/libdm-stats.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 78aa566..6ce6c57 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -4193,7 +4193,7 @@ static int _stats_resize_group(struct dm_stats_group *group,
return 0;
}
- log_very_verbose("Resizing group bitmap from %u to " FMTu64
+ log_very_verbose("Resizing group bitmap from " FMTu32 " to " FMTu64
" (last_bit: " FMTu64 ").", group->regions[0],
num_regions, last_bit);
7 years, 1 month
master - libdm: fix incorrect format specifier in _stats_resize_group()
by Bryn Reeves
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e8d5e05ff57a327053f...
Commit: e8d5e05ff57a327053f140f2fed4c12f8fe7e076
Parent: b8b2b1efd84fb1e96500d86f2ada3c2efa1338f3
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Thu Mar 30 10:31:36 2017 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Thu Mar 30 10:31:36 2017 +0100
libdm: fix incorrect format specifier in _stats_resize_group()
The bitmap size in dm_bitset_t[0] is a uint32_t, not uint64_t: use
%u instead of FMTu64.
---
libdm/libdm-stats.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index b69302f..78aa566 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -4193,9 +4193,9 @@ static int _stats_resize_group(struct dm_stats_group *group,
return 0;
}
- log_very_verbose("Resizing group bitmap from " FMTu64
- " to " FMTu64 " (last_bit: " FMTu64 ").",
- group->regions[0], num_regions, last_bit);
+ log_very_verbose("Resizing group bitmap from %u to " FMTu64
+ " (last_bit: " FMTu64 ").", group->regions[0],
+ num_regions, last_bit);
new = dm_bitset_create(NULL, (unsigned) num_regions);
if (!new) {
7 years, 1 month
master - dmsetup: Flush ouptut when using --interval
by Bryn Reeves
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b8b2b1efd84fb1e9650...
Commit: b8b2b1efd84fb1e96500d86f2ada3c2efa1338f3
Parent: c7e4b97abc86da766d8465ff6c9bbc6b77766bba
Author: Nir Soffer <nsoffer(a)redhat.com>
AuthorDate: Thu Mar 30 10:17:32 2017 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Thu Mar 30 10:17:32 2017 +0100
dmsetup: Flush ouptut when using --interval
---
tools/dmsetup.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index d25b3bd..44ea6f9 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -7080,6 +7080,7 @@ doit:
if (_count > 1 && r) {
printf("\n");
+ fflush(stdout);
/* wait for --interval and update timestamps */
if (!_do_report_wait()) {
ret = 1;
7 years, 1 month
master - libdm: use uint64_t where possible in filemap routines
by Bryn Reeves
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c7e4b97abc86da766d8...
Commit: c7e4b97abc86da766d8465ff6c9bbc6b77766bba
Parent: b823646aced03e49eb7f42aa9872d7e31f3fa1a4
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Wed Mar 29 20:49:03 2017 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Thu Mar 30 10:02:54 2017 +0100
libdm: use uint64_t where possible in filemap routines
Use uint64_t where possible and explicit casts elsewhere to avoid
compiler warnings when converting between int, int64_t and
uint64_t.
---
libdm/libdm-stats.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 2a6c343..b69302f 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -4511,8 +4511,9 @@ static int _stats_unmap_regions(struct dm_stats *dms, uint64_t group_id,
{
struct dm_stats_region *region = NULL;
struct dm_stats_group *group = NULL;
- int64_t nr_kept, nr_old, i;
+ uint64_t nr_kept, nr_old;
struct _extent ext;
+ int64_t i;
group = &dms->groups[group_id];
@@ -4571,7 +4572,7 @@ static int _stats_unmap_regions(struct dm_stats *dms, uint64_t group_id,
log_very_verbose("Found " FMTu64 " new extents",
*count - nr_kept);
- return nr_kept;
+ return (int) nr_kept;
out:
dm_pool_abandon_object(mem);
return -1;
@@ -4594,15 +4595,15 @@ static uint64_t *_stats_map_file_regions(struct dm_stats *dms, int fd,
uint64_t *count, int *regroup)
{
struct _extent *extents = NULL, *old_extents = NULL;
- uint64_t *regions = NULL, fail_region;
+ uint64_t *regions = NULL, fail_region, i, num_bits;
struct dm_stats_group *group = NULL;
struct dm_pool *extent_mem = NULL;
struct _extent *old_ext;
char *hist_arg = NULL;
- int update, num_bits;
struct statfs fsbuf;
- int64_t nr_kept = 0, i;
+ int64_t nr_kept = 0;
struct stat buf;
+ int update;
update = _stats_group_id_present(dms, group_id);
7 years, 1 month