[Crash-utility] [PATCH] crash: allow also block devices as dump file input

Michael Holzheu holzheu at linux.vnet.ibm.com
Wed Nov 25 19:58:21 UTC 2015


On s390 we have stand-alone dump tools that write the dump directly to a
block device partition. It is possible to use the partition device node
instead of a dump file when running crash. When we do that, everything works
fine but we get the following (a bit misleading) warning:

  WARNING: /dev/sda1: may be truncated or incomplete
  PT_LOAD p_offset: 16384
  p_filesz: 5497558138880
  bytes required: 5497558155264
  dumpfile size: 0

Fix this and print the following info message for block devices:

  NOTE: /dev/sda1: No dump complete check for block devices

Signed-off-by: Michael Holzheu <holzheu at linux.vnet.ibm.com>
---
 netdump.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/netdump.c
+++ b/netdump.c
@@ -605,6 +605,11 @@ check_dumpfile_size(char *file)
 	if (stat64(file, &stat) < 0)
 		return;
 
+	if (S_ISBLK(stat.st_mode)) {
+		error(NOTE, "%s: No dump complete check for block devices\n",
+		      file);
+		return;
+	}
 	for (i = 0; i < nd->num_pt_load_segments; i++) {
 		pls = &nd->pt_load_segments[i];
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crash-7.1.2-allow-block-dev.patch
Type: text/x-patch
Size: 1083 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20151125/ae87014f/attachment.bin>


More information about the Crash-utility mailing list