Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=34da83d729436d24…
Commit: 34da83d729436d245e91e24e30b6996862fe7725
Parent: 5c55c4ac18f60822da6bf61dde9dec3467a9e79a
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Oct 18 18:01:52 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Oct 18 18:01:52 2016 +0100
dmsetup: Produce partial output if dev disappears.
If a device disappears after obtaining the list of devices but before
processing it as a member of that list, dmsetup exits with a failure code.
Most commands still produce what output they can in these circumstances,
but 'ls --tree' and 'info -c' with fields depending on device dependencies
didn't. Change this.
---
WHATS_NEW_DM | 1 +
tools/dmsetup.c | 53 ++++++++++++++++++++++++++++++++++++-----------------
2 files changed, 37 insertions(+), 17 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index c69eb27..58a302e 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.136 -
======================================
+ Still produce output when dmsetup dependency tree building finds dev missing.
Check and report pthread_sigmask() failure in dmeventd.
Check mem alloc fail in _canonicalize_field_ids().
Use unsigned math when checking more then 31 legs of raid.
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 5b817bb..9d357ec 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -2707,6 +2707,9 @@ static int _add_dep(CMD_ARGS)
/*
* Create and walk dependency tree
+ *
+ * An incomplete _dtree may still be used by the caller,
+ * but the error must be reported.
*/
static int _build_whole_deptree(const struct command *cmd)
{
@@ -2724,12 +2727,14 @@ static int _build_whole_deptree(const struct command *cmd)
static int _display_tree(CMD_ARGS)
{
- if (!_build_whole_deptree(cmd))
- return_0;
+ int r;
- _display_tree_walk_children(dm_tree_find_node(_dtree, 0, 0), 0);
+ r = _build_whole_deptree(cmd);
- return 1;
+ if (_dtree)
+ _display_tree_walk_children(dm_tree_find_node(_dtree, 0, 0), 0);
+
+ return r;
}
/*
@@ -4471,9 +4476,14 @@ static int _report_init(const struct command *cmd, const char *subcommand)
selection, NULL, NULL)))
goto_out;
- if ((_report_type & DR_TREE) && cmd && !_build_whole_deptree(cmd)) {
- err("Internal device dependency tree creation failed.");
- goto out;
+ r = 1;
+
+ if ((_report_type & DR_TREE) && cmd) {
+ r = _build_whole_deptree(cmd);
+ if (!_dtree) {
+ err("Internal device dependency tree creation failed.");
+ goto out;
+ }
}
if (!_switches[INTERVAL_ARG])
@@ -4484,8 +4494,6 @@ static int _report_init(const struct command *cmd, const char *subcommand)
if (field_prefixes)
dm_report_set_output_field_name_prefix(_report, "dm_");
- r = 1;
-
out:
if (len)
dm_free(options);
@@ -6782,8 +6790,15 @@ unknown:
argc--, argv++;
}
- if (_switches[COLS_ARG] && !_report_init(cmd, subcommand))
- goto_out;
+ /* Default to success */
+ ret = 0;
+
+ if (_switches[COLS_ARG]) {
+ if (!_report_init(cmd, subcommand))
+ ret = 1;
+ if (!_report)
+ goto_out;
+ }
if (_switches[COUNT_ARG])
_count = ((uint32_t)_int_args[COUNT_ARG]) ? : UINT32_MAX;
@@ -6795,14 +6810,17 @@ unknown:
&_disp_units);
if (!_disp_factor) {
log_error("Invalid --units argument.");
+ ret = 1;
goto out;
}
}
/* Start interval timer. */
if (_count > 1)
- if (!_start_timer())
+ if (!_start_timer()) {
+ ret = 1;
goto_out;
+ }
doit:
multiple_devices = (cmd->repeatable_cmd && argc != 1 &&
@@ -6819,18 +6837,19 @@ doit:
if (_count > 1 && r) {
printf("\n");
/* wait for --interval and update timestamps */
- if (!_do_report_wait())
+ if (!_do_report_wait()) {
+ ret = 1;
goto_out;
+ }
}
}
- if (!r)
+ if (!r) {
+ ret = 1;
goto_out;
+ }
} while (--_count);
- /* Success */
- ret = 0;
-
out:
if (_report)
dm_report_free(_report);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4fab8339207fd884…
Commit: 4fab8339207fd8846e04e775897a7ba7a3cd074c
Parent: 2830f722882d064a6ffbe143f5a580364bcba2e6
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Tue Oct 11 09:42:18 2016 -0500
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Tue Oct 11 13:16:57 2016 -0500
lvmdbusd: Remove log ouput when ec=0 & stderr != 0 bytes
lvm likes to log to stderr virtually all the time, this isn't
helpful.
---
daemons/lvmdbusd/cmdhandler.py | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/daemons/lvmdbusd/cmdhandler.py b/daemons/lvmdbusd/cmdhandler.py
index 4bdbee5..fa34a7a 100644
--- a/daemons/lvmdbusd/cmdhandler.py
+++ b/daemons/lvmdbusd/cmdhandler.py
@@ -108,12 +108,6 @@ def call_lvm(command, debug=False):
if debug or process.returncode != 0:
_debug_c(command, process.returncode, (stdout_text, stderr_text))
- if process.returncode == 0:
- if cfg.args and cfg.args.debug and out[1] and len(out[1]) and \
- 'help' not in command:
- log_error('WARNING: lvm is out-putting text to STDERR on success!')
- _debug_c(command, process.returncode, (stdout_text, stderr_text))
-
return process.returncode, stdout_text, stderr_text
# The actual method which gets called to invoke the lvm command, can vary
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2830f722882d064a…
Commit: 2830f722882d064a6ffbe143f5a580364bcba2e6
Parent: fe437a6e7d9367eecd977d2504db82469016c780
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Tue Oct 11 09:36:47 2016 -0500
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Tue Oct 11 13:16:57 2016 -0500
lvmdbusd: Disable lvm abort on too much log output
The commit:
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=34c55d98eefd88f85476c…
introduced an abort if lvm logs too much. In the case of utilizing
lvm shell this is a pretty normal occurance, so we will disable
when we use lvm shell.
---
daemons/lvmdbusd/lvm_shell_proxy.py | 4 ++++
test/api/dbustest.sh | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/daemons/lvmdbusd/lvm_shell_proxy.py b/daemons/lvmdbusd/lvm_shell_proxy.py
index 6e6d52a..9edf336 100755
--- a/daemons/lvmdbusd/lvm_shell_proxy.py
+++ b/daemons/lvmdbusd/lvm_shell_proxy.py
@@ -121,6 +121,10 @@ class LVMShellProxy(object):
local_env["LVM_REPORT_FD"] = "32"
local_env["LVM_COMMAND_PROFILE"] = "lvmdbusd"
+ # Disable the abort logic if lvm logs too much, which easily happens
+ # when utilizing the lvm shell.
+ local_env["LVM_LOG_FILE_MAX_LINES"] = "0"
+
flags = fcntl(self.report_r, F_GETFL)
fcntl(self.report_r, F_SETFL, flags | os.O_NONBLOCK)
diff --git a/test/api/dbustest.sh b/test/api/dbustest.sh
index 16dc186..5ffe967 100644
--- a/test/api/dbustest.sh
+++ b/test/api/dbustest.sh
@@ -29,8 +29,4 @@ export LVM_BINARY=$TESTOLDPWD/../tools/lvm
aux prepare_lvmdbusd
-# Lets limit testing until the lvm SIGABRT is fixed as
-# we are running into that when using the lvm shell
-export LVM_DBUS_TEST_SHELL=0
-
$test_data_dir/dbus/lvmdbustest.py -v