]> sourceware.org Git - lvm2.git/commitdiff
dmsetup: fix 'splitname -o' to not fail if used without '-c'
authorPeter Rajnoha <prajnoha@redhat.com>
Tue, 12 Mar 2013 11:37:24 +0000 (12:37 +0100)
committerPeter Rajnoha <prajnoha@redhat.com>
Tue, 12 Mar 2013 12:01:57 +0000 (13:01 +0100)
This was a regression introduced with e33fd978a8a56228677c14612fce99b3b3588125
(libdm v1.02.68/lvm2 v2.02.89) with the introduction of new output
fields blkdevname and blkdevs_used for ls and deps dmsetup commands.

A new common '_process_options' fn was added with that commit, but the
fn was called prematurely which then broke processing of
'dmsetup splitname -o' which should implicitly use '-c' option
and this was failing after the commit:

  alatyr/~ $ dmsetup splitname -o lv_name /dev/mapper/vg_data-test
  Option not recognised: lv_name
  Couldn't process command line.

The '-c' had to be used for correct operation:

  alatyr/~ $ dmsetup splitname -c -o lv_name /dev/mapper/vg_data-test
  LV
  test

Now fixed to work as it did before:

  alatyr/~ $ dmsetup splitname -o lv_name /dev/mapper/vg_data-test
  LV
  test

WHATS_NEW_DM
tools/dmsetup.c

index 3bf89270d079380ddedff28b4a3dedf405f978f5..98ffa6fb89542792679fb484dc649f251845e17e 100644 (file)
@@ -1,5 +1,6 @@
 Version 1.02.78 - 
 ===================================
+  Fix 'dmsetup splitname -o' to not fail if used without '-c' switch (1.02.68).
   Add dm_config_write_{node_out/one_node_out} for enhanced config output.
   Add dm_config_value_is_bool to check for boolean value in supported formats.
   Fix config node lookup inside empty sections to not return the section itself.
index 8b1145fa06b3220ed8caa8731e4df9b127dbcee6..ce46d6c7185dd440e539c12d331217407e011d2e 100644 (file)
@@ -3749,9 +3749,6 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir)
                return 0;
        }
 
-       if (!_process_options(_string_args[OPTIONS_ARG]))
-               return 0;
-
        if (_switches[TABLE_ARG] && _switches[NOTABLE_ARG]) {
                fprintf(stderr, "--table and --notable are incompatible.\n");
                return 0;
@@ -3824,6 +3821,11 @@ int main(int argc, char **argv)
        if (!strcmp(cmd->name, "mangle"))
                dm_set_name_mangling_mode(DM_STRING_MANGLING_NONE);
 
+       if (!_process_options(_string_args[OPTIONS_ARG])) {
+               fprintf(stderr, "Couldn't process command line.\n");
+               goto out;
+       }
+
        if (_switches[COLS_ARG]) {
                if (!_report_init(cmd))
                        goto out;
This page took 0.052015 seconds and 5 git commands to generate.