Return-Path: yishimat@redhat.com Received: from zmta01.collab.prod.int.phx2.redhat.com (LHLO zmta01.collab.prod.int.phx2.redhat.com) (10.5.81.8) by zmail24.collab.prod.int.phx2.redhat.com with LMTP; Thu, 2 Jul 2015 01:15:32 -0400 (EDT) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by zmta01.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id C144F1835B7; Thu, 2 Jul 2015 01:15:32 -0400 (EDT) Received: from [10.3.112.13] ([10.3.112.13]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t625FTop028995; Thu, 2 Jul 2015 01:15:30 -0400 Subject: [RHEL7.2 PATCH resend v3 3/4] Implementation of dealing with kdump-compressed dumpfile with ENOSPC error. To: kexec-kdump-list@redhat.com References: <55929BD5.7050709@redhat.com> <5594C856.6050503@redhat.com> Cc: Minfei Huang , bhe@redhat.com, yishimat@redhat.com From: Yasuaki Ishimatsu Message-ID: <5594C8F1.3070006@redhat.com> Date: Thu, 2 Jul 2015 01:15:29 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <5594C856.6050503@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Content-Length: 4314 https://bugzilla.redhat.com/show_bug.cgi?id=1182377 The patch is back ported directory from the following upstream commit: commit 76025d3ca228affdd124b874b06d7a69573391e9 Author: Wang Xiao Date: Mon Oct 20 13:39:16 2014 +0900 [PATCH v4 3/4] Implementation of dealing with kdump-compressed dumpfile with ENOSPC error. kdump-compressed: Dump the bitmap before any page header and page data. This format use "status" of "disk_dump_header" to indicate that it has been modified. Signed-of-by: Wang Xiao Resolves: rhbz#1182377 Signed-off-by: Yasuaki Ishimatsu Acked-by: Minfei Huang num_dumpfile]; + + for (i = 0; i < info->num_dumpfile; i++) { + if ((pid = fork()) < 0) { + return FALSE; + + } else if (pid == 0) { /* Child */ + if (!check_and_modify_kdump_headers(SPLITTING_DUMPFILE(i))) + exit(1); + exit(0); + } + array_pid[i] = pid; + } + + for (i = 0; i < info->num_dumpfile; i++) { + waitpid(array_pid[i], &status, WUNTRACED); + if (!WIFEXITED(status) || WEXITSTATUS(status) == 1) { + ERRMSG("Check and modify the incomplete dumpfile(%s) failed.\n", + SPLITTING_DUMPFILE(i)); + ret = FALSE; + } + } + + return ret; +} + +int check_and_modify_headers() { if (info->flag_elf_dumpfile) return check_and_modify_elf_headers(info->name_dumpfile); + else + if(info->flag_split) + return check_and_modify_multiple_kdump_headers(); + else + return check_and_modify_kdump_headers(info->name_dumpfile); return FALSE; } @@ -7123,11 +7193,11 @@ write_kdump_pages_and_bitmap_cyclic(struct cache_data *cd_header, struct cache_d if (!exclude_unnecessary_pages_cyclic(&cycle)) return FALSE; - if (!write_kdump_pages_cyclic(cd_header, cd_page, &pd_zero, - &offset_data, &cycle)) + if (!write_kdump_bitmap2_cyclic(&cycle)) return FALSE; - if (!write_kdump_bitmap2_cyclic(&cycle)) + if (!write_kdump_pages_cyclic(cd_header, cd_page, &pd_zero, + &offset_data, &cycle)) return FALSE; } @@ -8127,12 +8197,12 @@ writeout_dumpfile(void) } else { if (!write_kdump_header()) goto out; + if (!write_kdump_bitmap()) + goto out; if (!write_kdump_pages(&cd_header, &cd_page)) goto out; if (!write_kdump_eraseinfo(&cd_page)) goto out; - if (!write_kdump_bitmap()) - goto out; } if (info->flag_flatten) { if (!write_end_flat_header()) -- 1.7.1