FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 01-30-2009, 01:51 PM
Cliff Wickman
 
Default crash: execution machine pagesize differs

This patch allows a machine to read a dump when that dump was taken on
a machine with a larger page size.
e.g. we had a dump of a 64k pagesize system, and ran crash on a
machine with a 16k pagesize.

Diffed against crash-4.0-7.6

Signed-off-by: Cliff Wickman <cpw@sgi.com>

---
diskdump.c | 25 +++++++++++++++++++------
tools.c | 2 ++
2 files changed, 21 insertions(+), 6 deletions(-)

Index: crash-4.0-7.6.ia64/diskdump.c
================================================== =================
--- crash-4.0-7.6.ia64.orig/diskdump.c
+++ crash-4.0-7.6.ia64/diskdump.c
@@ -107,7 +107,7 @@ static int read_dump_header(char *file)
struct disk_dump_sub_header *sub_header = NULL;
struct kdump_sub_header *sub_header_kdump = NULL;
int bitmap_len;
- const int block_size = (int)sysconf(_SC_PAGESIZE);
+ int block_size = (int)sysconf(_SC_PAGESIZE);
off_t offset;
const off_t failed = (off_t)-1;
ulong pfn;
@@ -165,12 +165,25 @@ static int read_dump_header(char *file)
machine_type_mismatch(file, "PPC64", NULL, 0))
goto err;

- if (header->block_size != block_size) {
- error(INFO, "%s: block size in the dump header does not match"
- " with system page size
",
- DISKDUMP_VALID() ? "diskdump" : "compressed kdump");
- goto err;
+ /*
+ * Up to here, the header was assumed to be one page in size.
+ * We checked utsname and signature, which are up front in the
+ * header. But all of the task array may not have been entirely
+ * read if the executing machines's page size is smaller than that
+ * of the dumped machine.
+ * Re-read the entire header if its block_size is bigger than the
+ * executing machine's page size.
+ */
+ if (header->block_size > block_size) {
+ block_size = header->block_size;
+ free(header);
+ if ((header = malloc(block_size)) == NULL)
+ error(FATAL,
+ "diskdump / compressed kdump: cannot malloc block_size buffer
");
+ lseek(dd->dfd, 0, SEEK_SET);
+ read(dd->dfd, header, block_size);
}
+
dd->block_size = block_size;
dd->block_shift = ffs(block_size) - 1;


--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 

Thread Tools




All times are GMT. The time now is 06:21 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org