Commit Graph

1 Commits

Author SHA1 Message Date
Kazuhito Hagio a0db00d575 makedumpfile: Fix inconsistent return value from find_vmemmap()
Backport from the makedumpfile devel branch in upstream.

commit 8425342a52b23d462f10bceeeb1c8a3a43d56bf0
Author: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Date:   Fri Sep 6 09:50:34 2019 -0400

    [PATCH] Fix inconsistent return value from find_vmemmap()

    When -e option is given, the find_vmemmap() returns FAILED(1) if
    it failed on x86_64, but on architectures other than that, it is
    stub_false() and returns FALSE(0).

              if (info->flag_excludevm) {
                      if (find_vmemmap() == FAILED) {
                              ERRMSG("Can't find vmemmap pages\n");

      #define find_vmemmap()          stub_false()

    As a result, on the architectures other than x86_64, the -e option
    does some unnecessary processing with no effect, and marks the dump
    DUMP_DH_EXCLUDED_VMEMMAP unexpectedly.

    Also, the functions for the -e option return COMPLETED or FAILED,
    which are for command return value, not for function return value.

    So let's fix the issue by following the common style that returns
    TRUE or FALSE, and avoid confusion.

    Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>

Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Acked-by: Kairui Song <kasong@redhat.com>
2019-09-20 16:37:44 +08:00