[PATCH] makedumpfile: when using refiltering, initialize bitmap1 from the kdump file's bitmap2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When refiltering on kdump format file, there is no info about pt_load[] for
exclude_nodata_pages(), and also we can not expect more data than the kdump
file can provide, hence this patch suggests to initialize the refiltered
bitmap1 from the kdump file's bitmap2.

Note about the bug reported by the following ops:
  makedumpfile -l --message-level 1 -d 31 /proc/vmcore /path/to/vmcore
  makedumpfile  --split  -d 31 ./vmcore dumpfile_{1,2,3} 2>&1
and hit the following error:
  Excluding unnecessary pages                       : [100.0 %] \
  readpage_kdump_compressed: pfn(9b) is excluded from /var/crash/127.0.0.1-2018-07-02-22:10:38/vmcore.
  readmem: type_addr: 1, addr:9b000, size:4096
  read_pfn: Can't get the page data.
  writeout_multiple_dumpfiles: Child process(2277) finished incompletely.(256)
  Copying data                                      : [ 24.6 %] -           eta: 2s
  makedumpfile Failed.

Signed-off-by: Pingfan Liu <piliu@xxxxxxxxxx>
---
 makedumpfile.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index 101fa7c..af24359 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -5544,6 +5544,7 @@ copy_1st_bitmap_from_memory(void)
 
 	bitmap_offset = (DISKDUMP_HEADER_BLOCKS + dh->sub_hdr_size)
 			 * dh->block_size;
+	bitmap_offset += info->len_bitmap / 2;
 
 	if (lseek(info->fd_memory, bitmap_offset, SEEK_SET) < 0) {
 		ERRMSG("Can't seek %s. %s\n",
@@ -5593,8 +5594,11 @@ create_1st_bitmap_file(void)
 	struct timespec ts_start;
 	off_t offset_page;
 
-	if (info->flag_refiltering)
+	if (info->flag_refiltering) {
+		/* no hole info in kdump file, set it as 0 for refiltering */
+		pfn_memhole = 0;
 		return copy_1st_bitmap_from_memory();
+	}
 
 	if (info->flag_sadump)
 		return sadump_copy_1st_bitmap_from_memory();
-- 
2.7.4


_______________________________________________
kexec mailing list
kexec@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/kexec



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux