Re: handling missing kdump pages in diskdump format

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

 



On Mon, 2007-03-05 at 20:18 +0900, Ken'ichi Ohmichi wrote:
> Hi Bob,
> 

> In the above patch, a user cannot distinguish between the original
> unaccessable pages and the excluded pages.
> I think that the crash utility should display the warning message
> to mean "These pages are excluded by partial dump" when it accesses 
> the excluded pages.

I'm not sure how to do this.  I think it will require modifying memory.c
in crash to accept another type of return value from read_diskdump,
maybe?


> I think it is good that disk_dump_header.header_version will be changed
> from 0 into 1. The existing crash doesn't check header_version.
> If the existing crash tries to read a new dumpfile (header_version==1),
> it considers the excluded pages as the zero-filled pages and it can
> read a new dumpfile, and a new crash can distinguish the excluded pages.

That sounds like a great way to fix the compatibility issue.
> 
> For the above, I created the attached patch (for makedumpfile-1.1.1).
> Could you say the opinion ?

I didn't even think of pointing multiple page descriptors at a single
zero page.  That looks a lot cleaner than dropping in compressed zero
pages like I was doing.  I like it.  Good idea!

I have one minor comment with your method.  I think it might be better
to memset the data buffer to zero just before writing it, instead of
using calloc to allocate it up front and counting on it to still be zero
when you get to the DL_EXCLUDE_ZERO if block.  Some future programmer
might use buf in between the calloc and the write_cache. 

I attached a small patch that applies *after* your patch to 1.1.1 that
shows this.

Thanks,
Bob Montgomery
--- makedumpfile.c.patched	2007-03-05 16:21:27.000000000 -0700
+++ makedumpfile.c	2007-03-05 16:25:49.000000000 -0700
@@ -3887,7 +3887,7 @@ write_kdump_pages(struct DumpInfo *info)
 	bitmap2.buf       = NULL;
 	bitmap2.offset    = info->len_bitmap/2;
 
-	if ((buf = calloc(1, info->page_size)) == NULL) {
+	if ((buf = malloc(info->page_size)) == NULL) {
 		ERRMSG("Can't allocate memory for the page. %s\n",
 		    strerror(errno));
 		goto out;
@@ -3961,6 +3961,7 @@ write_kdump_pages(struct DumpInfo *info)
 		pd_zero.flags = 0;
 		pd_zero.offset = offset_data;
 		pd_zero.page_flags = 0;
+		memset(buf, 0, pd_zero.size);
 		if (!write_cache(&pdata, buf, pd_zero.size))
 			goto out;
 		offset_data  += pd_zero.size;
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux