master - commands: fix missing skip condition in coverity fixes
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=43388f12208be07191b...
Commit: 43388f12208be07191b80a5ed328a87790ecd64a
Parent: a9341b18ef6cb20245a74fc97aa28dd7283804f3
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Mar 10 11:49:24 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Mar 10 11:50:00 2017 -0600
commands: fix missing skip condition in coverity fixes
Fix for commit 5e6ea4b7
---
tools/command.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/command.c b/tools/command.c
index aacc647..9594284 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -1506,7 +1506,8 @@ int define_commands(char *run_name)
continue;
}
- log_error("Parsing command defs: can't process input line %s", line_orig);
+ if (!skip)
+ log_error("Parsing command defs: can't process input line %s", line_orig);
}
for (i = 0; i < COMMAND_COUNT; i++) {
7 years, 1 month
master - daemons: use DEFAULT_PROC_DIR in dmfilemapd
by Bryn Reeves
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a9341b18ef6cb20245a...
Commit: a9341b18ef6cb20245a74fc97aa28dd7283804f3
Parent: b17eb054cd79d26573bf8a9ad1621dd1026cb11d
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Mar 10 17:25:11 2017 +0000
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Mar 10 17:26:47 2017 +0000
daemons: use DEFAULT_PROC_DIR in dmfilemapd
Include defaults.h and use it to obtain the default procfs mount
point in dmfilemapd.
---
daemons/dmfilemapd/dmfilemapd.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/daemons/dmfilemapd/dmfilemapd.c b/daemons/dmfilemapd/dmfilemapd.c
index 67f86d3..6d7c09f 100644
--- a/daemons/dmfilemapd/dmfilemapd.c
+++ b/daemons/dmfilemapd/dmfilemapd.c
@@ -18,6 +18,8 @@
#include "dm-logging.h"
+#include "defaults.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -146,7 +148,8 @@ static int _is_open_in_pid(pid_t pid, const char *path)
if (pid == getpid())
return 0;
- if (dm_snprintf(path_buf, sizeof(path_buf), "/proc/%d/fd", pid) < 0) {
+ if (dm_snprintf(path_buf, sizeof(path_buf),
+ DEFAULT_PROC_DIR "%d/fd", pid) < 0) {
log_error("Could not format pid path.");
goto bad;
}
@@ -170,7 +173,8 @@ static int _is_open_in_pid(pid_t pid, const char *path)
continue;
if ((len = readlinkat(dirfd(pid_d), pid_dp->d_name, link_buf,
sizeof(link_buf))) < 0) {
- log_error("readlink failed for /proc/%d/fd/.", pid);
+ log_error("readlink failed for " DEFAULT_PROC_DIR
+ "/%d/fd/.", pid);
goto bad;
}
link_buf[len] = '\0';
@@ -211,7 +215,7 @@ static int _is_open(const char *path)
DIR *proc_d = NULL;
pid_t pid;
- proc_d = opendir("/proc");
+ proc_d = opendir(DEFAULT_PROC_DIR);
if (!proc_d)
return 0;
while ((proc_dp = readdir(proc_d)) != NULL) {
@@ -563,13 +567,13 @@ check_unlinked:
* whether it is still reachable in the filesystem, or if it is
* unlinked and anonymous.
*/
- if (dm_snprintf(path_buf, sizeof(path_buf),
- "/proc/%d/fd/%d", getpid(), fm->fd) < 0) {
+ if (dm_snprintf(path_buf, sizeof(path_buf), DEFAULT_PROC_DIR
+ "/%d/fd/%d", getpid(), fm->fd) < 0) {
log_error("Could not format pid path.");
return 0;
}
if ((len = readlink(path_buf, link_buf, sizeof(link_buf))) < 0) {
- log_error("readlink failed for /proc/%d/fd/%d.",
+ log_error("readlink failed for " DEFAULT_PROC_DIR "/%d/fd/%d.",
getpid(), fm->fd);
return 0;
}
7 years, 1 month
master - daemons: cleanup dmeventd references from dmfilemapd/Makefile.in
by Bryn Reeves
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b17eb054cd79d26573b...
Commit: b17eb054cd79d26573bf8a9ad1621dd1026cb11d
Parent: 5e6ea4b7844c81affd8521902eac9808bfe29232
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Mar 10 17:12:04 2017 +0000
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Mar 10 17:26:47 2017 +0000
daemons: cleanup dmeventd references from dmfilemapd/Makefile.in
---
daemons/dmfilemapd/Makefile.in | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/daemons/dmfilemapd/Makefile.in b/daemons/dmfilemapd/Makefile.in
index 98fb9a8..28326d2 100644
--- a/daemons/dmfilemapd/Makefile.in
+++ b/daemons/dmfilemapd/Makefile.in
@@ -19,7 +19,7 @@ SOURCES = dmfilemapd.c
TARGETS = dmfilemapd
-.PHONY: install_dmeventd install_dmeventd_static
+.PHONY: install_dmfilemapd install_dmfilemapd_static
INSTALL_DMFILEMAPD_TARGETS = install_dmfilemapd_dynamic
@@ -35,9 +35,8 @@ all: device-mapper
device-mapper: $(TARGETS)
LIBS += -ldevmapper
-LVMLIBS += -ldevmapper-event $(PTHREAD_LIBS)
-CFLAGS_dmeventd.o += $(EXTRA_EXEC_CFLAGS)
+CFLAGS_dmfilemapd.o += $(EXTRA_EXEC_CFLAGS)
dmfilemapd: $(LIB_SHARED) dmfilemapd.o
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS) -L. -o $@ dmfilemapd.o \
7 years, 1 month
master - commands: coverity fixes
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5e6ea4b7844c81affd8...
Commit: 5e6ea4b7844c81affd8521902eac9808bfe29232
Parent: 8c6b8e90e34df6742cfb348ad9225cbdf6b51283
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Mar 10 10:19:21 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Mar 10 10:54:42 2017 -0600
commands: coverity fixes
---
tools/command.c | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/tools/command.c b/tools/command.c
index 88b7216..aacc647 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -711,7 +711,7 @@ static void set_opt_def(struct command *cmd, char *str, struct arg_def *def)
* oo->line = "--opt1 ...";
*/
-static void add_oo_definition_line(struct command *cmd, const char *name, const char *line)
+static void add_oo_definition_line(const char *name, const char *line)
{
struct oo_line *oo;
char *colon;
@@ -724,7 +724,6 @@ static void add_oo_definition_line(struct command *cmd, const char *name, const
*colon = '\0';
else {
log_error("Parsing command defs: invalid OO definition");
- cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
}
@@ -734,7 +733,7 @@ static void add_oo_definition_line(struct command *cmd, const char *name, const
/* Support OO_FOO: continuing on multiple lines. */
-static void append_oo_definition_line(struct command *cmd, const char *new_line)
+static void append_oo_definition_line(const char *new_line)
{
struct oo_line *oo;
char *old_line;
@@ -750,7 +749,6 @@ static void append_oo_definition_line(struct command *cmd, const char *new_line)
line = dm_malloc(len);
if (!line) {
log_error("Parsing command defs: no memory");
- cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
}
@@ -1424,7 +1422,7 @@ int define_commands(char *run_name)
* context of the existing command[].
*/
- if (is_desc_line(line_argv[0]) && !skip) {
+ if (is_desc_line(line_argv[0]) && !skip && cmd) {
char *desc = dm_strdup(line_orig);
if (cmd->desc) {
int newlen = strlen(cmd->desc) + strlen(desc) + 2;
@@ -1432,32 +1430,33 @@ int define_commands(char *run_name)
if (newdesc) {
memset(newdesc, 0, newlen);
snprintf(newdesc, newlen, "%s %s", cmd->desc, desc);
- cmd->desc = newdesc;
+ dm_free((char *)cmd->desc);
dm_free(desc);
+ cmd->desc = newdesc;
}
} else
cmd->desc = desc;
continue;
}
- if (is_flags_line(line_argv[0]) && !skip) {
+ if (is_flags_line(line_argv[0]) && !skip && cmd) {
add_flags(cmd, line_orig);
continue;
}
- if (is_rule_line(line_argv[0]) && !skip) {
+ if (is_rule_line(line_argv[0]) && !skip && cmd) {
add_rule(cmd, line_orig);
continue;
}
- if (is_id_line(line_argv[0])) {
+ if (is_id_line(line_argv[0]) && cmd) {
cmd->command_id = dm_strdup(line_argv[1]);
continue;
}
/* OO_FOO: ... */
if (is_oo_definition(line_argv[0])) {
- add_oo_definition_line(cmd, line_argv[0], line_orig);
+ add_oo_definition_line(line_argv[0], line_orig);
prev_was_oo_def = 1;
prev_was_oo = 0;
prev_was_op = 0;
@@ -1465,7 +1464,7 @@ int define_commands(char *run_name)
}
/* OO: ... */
- if (is_oo_line(line_argv[0]) && !skip) {
+ if (is_oo_line(line_argv[0]) && !skip && cmd) {
add_optional_opt_line(cmd, line_argc, line_argv);
prev_was_oo_def = 0;
prev_was_oo = 1;
@@ -1474,7 +1473,7 @@ int define_commands(char *run_name)
}
/* OP: ... */
- if (is_op_line(line_argv[0]) && !skip) {
+ if (is_op_line(line_argv[0]) && !skip && cmd) {
add_optional_pos_line(cmd, line_argc, line_argv);
prev_was_oo_def = 0;
prev_was_oo = 0;
@@ -1483,7 +1482,7 @@ int define_commands(char *run_name)
}
/* IO: ... */
- if (is_io_line(line_argv[0]) && !skip) {
+ if (is_io_line(line_argv[0]) && !skip && cmd) {
add_ignore_opt_line(cmd, line_argc, line_argv);
prev_was_oo = 0;
prev_was_op = 0;
@@ -1493,19 +1492,21 @@ int define_commands(char *run_name)
/* handle OO_FOO:, OO:, OP: continuing on multiple lines */
if (prev_was_oo_def) {
- append_oo_definition_line(cmd, line_orig);
+ append_oo_definition_line(line_orig);
continue;
}
- if (prev_was_oo) {
+ if (prev_was_oo && cmd) {
add_optional_opt_line(cmd, line_argc, line_argv);
continue;
}
- if (prev_was_op) {
+ if (prev_was_op && cmd) {
add_optional_pos_line(cmd, line_argc, line_argv);
continue;
}
+
+ log_error("Parsing command defs: can't process input line %s", line_orig);
}
for (i = 0; i < COMMAND_COUNT; i++) {
@@ -2158,7 +2159,7 @@ static void print_val_man(struct command_name *cname, int opt_enum, int val_enum
if (strstr(line_argv[i], "Number"))
printf("\\fI%s\\fP", line_argv[i]);
else
- printf("\\%\\fB%s\\fP", line_argv[i]);
+ printf("\\fB%s\\fP", line_argv[i]);
}
return;
}
@@ -3426,8 +3427,7 @@ int main(int argc, char *argv[])
define_commands(NULL);
- if (cmdname)
- configure_command_option_values(cmdname);
+ configure_command_option_values(cmdname);
factor_common_options();
7 years, 1 month
master - libdm: use correct value for NR_FILEMAPD_ARGS
by Bryn Reeves
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8c6b8e90e34df6742cf...
Commit: 8c6b8e90e34df6742cfb348ad9225cbdf6b51283
Parent: c71374531414081aa2aad71317dac55fc024a0d5
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Mar 10 16:52:27 2017 +0000
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Mar 10 16:52:27 2017 +0000
libdm: use correct value for NR_FILEMAPD_ARGS
The argument count for the file mapping daemon needs to account
for the program's name in argv[0] to avoid indexing off the end
of the argument array.
---
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 c83c27b..5fc4938 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -4927,7 +4927,7 @@ dm_filemapd_mode_t dm_filemapd_mode_from_string(const char *mode_str)
}
#define DM_FILEMAPD "dmfilemapd"
-#define NR_FILEMAPD_ARGS 6
+#define NR_FILEMAPD_ARGS 7 /* includes argv[0] */
/*
* Start dmfilemapd to monitor the specified file descriptor, and to
* update the group given by 'group_id' when the file's allocation
7 years, 1 month
master - commands: coverity fixes
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=053547d770191d9ca18...
Commit: 053547d770191d9ca180359d7bbfdc9f0528c036
Parent: 93644be44b4067c6ebc1d450589ca510129b3b60
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Mar 10 10:19:21 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Mar 10 10:40:59 2017 -0600
commands: coverity fixes
---
tools/command.c | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/tools/command.c b/tools/command.c
index 88b7216..aacc647 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -711,7 +711,7 @@ static void set_opt_def(struct command *cmd, char *str, struct arg_def *def)
* oo->line = "--opt1 ...";
*/
-static void add_oo_definition_line(struct command *cmd, const char *name, const char *line)
+static void add_oo_definition_line(const char *name, const char *line)
{
struct oo_line *oo;
char *colon;
@@ -724,7 +724,6 @@ static void add_oo_definition_line(struct command *cmd, const char *name, const
*colon = '\0';
else {
log_error("Parsing command defs: invalid OO definition");
- cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
}
@@ -734,7 +733,7 @@ static void add_oo_definition_line(struct command *cmd, const char *name, const
/* Support OO_FOO: continuing on multiple lines. */
-static void append_oo_definition_line(struct command *cmd, const char *new_line)
+static void append_oo_definition_line(const char *new_line)
{
struct oo_line *oo;
char *old_line;
@@ -750,7 +749,6 @@ static void append_oo_definition_line(struct command *cmd, const char *new_line)
line = dm_malloc(len);
if (!line) {
log_error("Parsing command defs: no memory");
- cmd->cmd_flags |= CMD_FLAG_PARSE_ERROR;
return;
}
@@ -1424,7 +1422,7 @@ int define_commands(char *run_name)
* context of the existing command[].
*/
- if (is_desc_line(line_argv[0]) && !skip) {
+ if (is_desc_line(line_argv[0]) && !skip && cmd) {
char *desc = dm_strdup(line_orig);
if (cmd->desc) {
int newlen = strlen(cmd->desc) + strlen(desc) + 2;
@@ -1432,32 +1430,33 @@ int define_commands(char *run_name)
if (newdesc) {
memset(newdesc, 0, newlen);
snprintf(newdesc, newlen, "%s %s", cmd->desc, desc);
- cmd->desc = newdesc;
+ dm_free((char *)cmd->desc);
dm_free(desc);
+ cmd->desc = newdesc;
}
} else
cmd->desc = desc;
continue;
}
- if (is_flags_line(line_argv[0]) && !skip) {
+ if (is_flags_line(line_argv[0]) && !skip && cmd) {
add_flags(cmd, line_orig);
continue;
}
- if (is_rule_line(line_argv[0]) && !skip) {
+ if (is_rule_line(line_argv[0]) && !skip && cmd) {
add_rule(cmd, line_orig);
continue;
}
- if (is_id_line(line_argv[0])) {
+ if (is_id_line(line_argv[0]) && cmd) {
cmd->command_id = dm_strdup(line_argv[1]);
continue;
}
/* OO_FOO: ... */
if (is_oo_definition(line_argv[0])) {
- add_oo_definition_line(cmd, line_argv[0], line_orig);
+ add_oo_definition_line(line_argv[0], line_orig);
prev_was_oo_def = 1;
prev_was_oo = 0;
prev_was_op = 0;
@@ -1465,7 +1464,7 @@ int define_commands(char *run_name)
}
/* OO: ... */
- if (is_oo_line(line_argv[0]) && !skip) {
+ if (is_oo_line(line_argv[0]) && !skip && cmd) {
add_optional_opt_line(cmd, line_argc, line_argv);
prev_was_oo_def = 0;
prev_was_oo = 1;
@@ -1474,7 +1473,7 @@ int define_commands(char *run_name)
}
/* OP: ... */
- if (is_op_line(line_argv[0]) && !skip) {
+ if (is_op_line(line_argv[0]) && !skip && cmd) {
add_optional_pos_line(cmd, line_argc, line_argv);
prev_was_oo_def = 0;
prev_was_oo = 0;
@@ -1483,7 +1482,7 @@ int define_commands(char *run_name)
}
/* IO: ... */
- if (is_io_line(line_argv[0]) && !skip) {
+ if (is_io_line(line_argv[0]) && !skip && cmd) {
add_ignore_opt_line(cmd, line_argc, line_argv);
prev_was_oo = 0;
prev_was_op = 0;
@@ -1493,19 +1492,21 @@ int define_commands(char *run_name)
/* handle OO_FOO:, OO:, OP: continuing on multiple lines */
if (prev_was_oo_def) {
- append_oo_definition_line(cmd, line_orig);
+ append_oo_definition_line(line_orig);
continue;
}
- if (prev_was_oo) {
+ if (prev_was_oo && cmd) {
add_optional_opt_line(cmd, line_argc, line_argv);
continue;
}
- if (prev_was_op) {
+ if (prev_was_op && cmd) {
add_optional_pos_line(cmd, line_argc, line_argv);
continue;
}
+
+ log_error("Parsing command defs: can't process input line %s", line_orig);
}
for (i = 0; i < COMMAND_COUNT; i++) {
@@ -2158,7 +2159,7 @@ static void print_val_man(struct command_name *cname, int opt_enum, int val_enum
if (strstr(line_argv[i], "Number"))
printf("\\fI%s\\fP", line_argv[i]);
else
- printf("\\%\\fB%s\\fP", line_argv[i]);
+ printf("\\fB%s\\fP", line_argv[i]);
}
return;
}
@@ -3426,8 +3427,7 @@ int main(int argc, char *argv[])
define_commands(NULL);
- if (cmdname)
- configure_command_option_values(cmdname);
+ configure_command_option_values(cmdname);
factor_common_options();
7 years, 1 month
master - dmsetup: always initialise 'dms' in _stats_update_file()
by Bryn Reeves
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c71374531414081aa2a...
Commit: c71374531414081aa2aad71317dac55fc024a0d5
Parent: d28a50ec76c62c48a3be695569fe5e752b9ae684
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Mar 10 16:44:08 2017 +0000
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Mar 10 16:44:08 2017 +0000
dmsetup: always initialise 'dms' in _stats_update_file()
---
tools/dmsetup.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 945557f..1e22cf1 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -5650,8 +5650,8 @@ static int _stats_update_file(CMD_ARGS)
int foreground = _switches[FOREGROUND_ARG];
int verbose = _switches[VERBOSE_ARG];
char *path, *abspath = NULL;
+ struct dm_stats *dms = NULL;
dm_filemapd_mode_t mode;
- struct dm_stats *dms;
int fd = -1;
@@ -5764,8 +5764,7 @@ bad:
if ((fd > -1) && close(fd))
log_error("Error closing %s", path);
- if (dms)
- dm_stats_destroy(dms);
+ dm_stats_destroy(dms);
return 0;
}
7 years, 1 month
master - libdm: make dm_stats_destroy(NULL) a no-op
by Bryn Reeves
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d28a50ec76c62c48a3b...
Commit: d28a50ec76c62c48a3be695569fe5e752b9ae684
Parent: 93644be44b4067c6ebc1d450589ca510129b3b60
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Mar 10 16:41:28 2017 +0000
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Mar 10 16:41:28 2017 +0000
libdm: make dm_stats_destroy(NULL) a no-op
Test for NULL in dm_stats_destroy() and return immediately if
the struct dm_stats pointer is NULL (similar to free(NULL)).
This simplifies cleanup code which otherwise needs to:
out:
if (dms)
dm_stats_destroy(dms);
return;
---
libdm/libdm-stats.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 61c052f..c83c27b 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -2387,6 +2387,9 @@ bad:
*/
void dm_stats_destroy(struct dm_stats *dms)
{
+ if (!dms)
+ return;
+
_stats_regions_destroy(dms);
_stats_groups_destroy(dms);
_stats_clear_binding(dms);
7 years, 1 month
master - libdm: dm_stats_start_filemapd() mode can never be < 0
by Bryn Reeves
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=93644be44b4067c6ebc...
Commit: 93644be44b4067c6ebc1d450589ca510129b3b60
Parent: bc3bec6c5486105f50fe94e66c1a16dc0fdfe332
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Fri Mar 10 14:42:23 2017 +0000
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Fri Mar 10 14:42:23 2017 +0000
libdm: dm_stats_start_filemapd() mode can never be < 0
---
libdm/libdm-stats.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index cff23d8..61c052f 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -4948,8 +4948,7 @@ int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path,
return 0;
}
- if (mode < DM_FILEMAPD_FOLLOW_INODE
- || mode > DM_FILEMAPD_FOLLOW_PATH) {
+ if (mode > DM_FILEMAPD_FOLLOW_PATH) {
log_error("Invalid dmfilemapd mode argument: "
"Must be DM_FILEMAPD_FOLLOW_INODE or "
"DM_FILEMAPD_FOLLOW_PATH");
7 years, 1 month
master - raid: fix compile time warning
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bc3bec6c5486105f50f...
Commit: bc3bec6c5486105f50fe94e66c1a16dc0fdfe332
Parent: 59e57be54f9b4c9e83ec1ede480285965a7411eb
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Fri Mar 10 14:43:37 2017 +0100
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Fri Mar 10 14:43:37 2017 +0100
raid: fix compile time warning
---
lib/metadata/raid_manip.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index a8c2e19..2e31bf7 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -1491,7 +1491,7 @@ static int _lv_alloc_reshape_space(struct logical_volume *lv,
uint32_t data_rimages = _data_rimages_count(seg, seg->area_count);
uint32_t reshape_len = out_of_place_les_per_disk * data_rimages;
uint32_t prev_rimage_len = _lv_total_rimage_len(lv);
- uint64_t lv_size = lv->size;
+ uint64_t lv_size_cur = lv->size;
if (!lv_extend(lv, seg->segtype, data_rimages,
seg->stripe_size, 1, /* seg_is_any_raid10(seg) ? seg->data_copies : 1, */ seg->region_size,
@@ -1502,7 +1502,7 @@ static int _lv_alloc_reshape_space(struct logical_volume *lv,
return 0;
}
- lv->size = lv_size;
+ lv->size = lv_size_cur;
/* pay attention to lv_extend maybe having allocated more because of layout specific rounding */
if (!_lv_set_reshape_len(lv, _lv_total_rimage_len(lv) - prev_rimage_len))
return 0;
7 years, 1 month