Bug 607404 - UV support: makedumpfile: output files filling ramdisk
UV support: makedumpfile: output files filling ramdisk
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kexec-tools (Show other bugs)
6.0
x86_64 Linux
high Severity high
: rc
: 6.0
Assigned To: Cong Wang
Han Pingtian
:
Depends On:
Blocks: 555548
  Show dependency treegraph
 
Reported: 2010-06-23 22:24 EDT by George Beshers
Modified: 2013-09-29 22:18 EDT (History)
6 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description George Beshers 2010-06-23 22:24:49 EDT
David,
Again the patches are upstream and may already be in the RHEL
packages - I have not checked.

George


Description:

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
 open_dump_bitmap(void)
 {
        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",
                    strerror(errno));
                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 PFN_BUFBITMAP          (BITPERBYTE*BUFSIZE_BITMAP)
-#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:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 2 RHEL Product and Program Management 2010-06-23 22:52:53 EDT
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
inclusion.
Comment 4 Marizol Martinez 2010-07-08 11:31:44 EDT
George -- Per your comment in the description, please verify and update this BZ
accordingly. Thanks!
Comment 5 Cong Wang 2010-07-09 03:37:15 EDT
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 09:29:13 EST
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.