Bug 607404 - UV support: makedumpfile: output files filling ramdisk
Summary: UV support: makedumpfile: output files filling ramdisk
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kexec-tools   
(Show other bugs)
Version: 6.0
Hardware: x86_64 Linux
Target Milestone: rc
: 6.0
Assignee: Cong Wang
QA Contact: Han Pingtian
Depends On:
Blocks: 555548
TreeView+ depends on / blocked
Reported: 2010-06-24 02:24 UTC by George Beshers
Modified: 2013-09-30 02:18 UTC (History)
6 users (show)

Fixed In Version: kexec-tools-2_0_0-108_el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-11-15 14:29:13 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description George Beshers 2010-06-24 02:24:49 UTC
Again the patches are upstream and may already be in the RHEL
packages - I have not checked.



A fix for the makedumpfile command is needed to make dumps work on UV.

makedumpfile's path FILENAME_BITMAP "/tmp/..." causes it to try to write
bitmap files to the ramdisk.  These can be very large if the machine has
lots of memory, and so writing the file can fail.

A TMPDIR environment variable is set in the script
/lib/mkinitrd/scripts/boot-kdump.sh. So this patch assumes that
the FILENAME_BITMAP path should be based at TMPDIR.

The patch looks like this:

Index: makedumpfile-1.3.5/makedumpfile.c
--- makedumpfile-1.3.5.orig/makedumpfile.c
+++ makedumpfile-1.3.5/makedumpfile.c
@@ -933,14 +933,21 @@ int
        int i, fd;
+       char *tmpname;

-       if ((info->name_bitmap
-           = (char *)malloc(sizeof(FILENAME_BITMAP))) == NULL) {
+       tmpname = getenv("TMPDIR");
+       if (!tmpname)
+               tmpname = "/tmp";
+       if ((info->name_bitmap = (char *)malloc(sizeof(FILENAME_BITMAP) +
+                                               strlen(tmpname) + 1)) == NULL) {
                ERRMSG("Can't allocate memory for the filename. %s\n",
                return FALSE;
-       strcpy(info->name_bitmap, FILENAME_BITMAP);
+       strcpy(info->name_bitmap, tmpname);
+       strcat(info->name_bitmap, "/");
+       strcat(info->name_bitmap, FILENAME_BITMAP);
        if ((fd = mkstemp(info->name_bitmap)) < 0) {
                ERRMSG("Can't open the bitmap file(%s). %s\n",
                    info->name_bitmap, strerror(errno));
Index: makedumpfile-1.3.5/makedumpfile.h
--- makedumpfile-1.3.5.orig/makedumpfile.h
+++ makedumpfile-1.3.5/makedumpfile.h
@@ -230,7 +230,7 @@ do { \
 #define BUFSIZE_FGETS          (1500)
 #define BUFSIZE_BITMAP         (4096)
-#define FILENAME_BITMAP                "/tmp/kdump_bitmapXXXXXX"
+#define FILENAME_BITMAP                "kdump_bitmapXXXXXX"
 #define FILENAME_STDOUT                "STDOUT"

@@ -449,7 +449,7 @@ do { \
 #define KVER_MIN_SHIFT 16
 #define KERNEL_VERSION(x,y,z) (((x) << KVER_MAJ_SHIFT) | ((y) << KVER_MIN_SHIFT) | (z))
 #define OLDEST_VERSION         KERNEL_VERSION(2, 6, 15)/* linux-2.6.15 */
-#define LATEST_VERSION         KERNEL_VERSION(2, 6, 31)/* linux-2.6.31 */
+#define LATEST_VERSION         KERNEL_VERSION(2, 6, 32)/* linux-2.6.32 */

  * vmcoreinfo in /proc/vmcore

This patch is now upstream.  The original patch was separated into 2 patches
at Masayuki's request.  Both are applied.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:

Comment 2 RHEL Product and Program Management 2010-06-24 02:52:53 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for

Comment 4 Marizol Martinez 2010-07-08 15:31:44 UTC
George -- Per your comment in the description, please verify and update this BZ
accordingly. Thanks!

Comment 5 Cong Wang 2010-07-09 07:37:15 UTC
Please don't copy and paste the patch into BZ. Attach it as a patch please.

Comment 7 releng-rhel@redhat.com 2010-11-15 14:29:13 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.