All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.de>
To: ats-kumagai@wm.jp.nec.com
Cc: Martin Wilck <mwilck@suse.de>,
	ptesarik@suse.de, kexec@lists.infradead.org
Subject: [PATCH 2/3] move call to open_dump_bitmap() to after call to initial()
Date: Wed, 10 Aug 2016 14:56:57 +0200	[thread overview]
Message-ID: <20160810125658.23366-3-mwilck@suse.de> (raw)
In-Reply-To: <20160810125658.23366-1-mwilck@suse.de>

When open_files_for_creating_dumpfile() is called, we don't have all
necessary information to determine whether a bitmap file is actually
needed. In particular, we don't know whether info->flag_cyclic will
ultimately be set. This patch moves the call to open_dump_bitmap()
to after initialize() when all flags are known.

For the dump_dmesg() path, no bitmap file is needed.

Signed-off-by: Martin Wilck <mwilck@suse.de>
---
 makedumpfile.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index 9f05396..43278f1 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -1480,9 +1480,6 @@ open_files_for_creating_dumpfile(void)
 	if (!open_dump_memory())
 		return FALSE;
 
-	if (!open_dump_bitmap())
-		return FALSE;
-
 	return TRUE;
 }
 
@@ -9708,6 +9705,9 @@ create_dumpfile(void)
 	if (!initial())
 		return FALSE;
 
+	if (!open_dump_bitmap())
+		return FALSE;
+
 	/* create an array of translations from pfn to vmemmap pages */
 	if (info->flag_excludevm) {
 		if (find_vmemmap() == FAILED) {
@@ -10878,6 +10878,9 @@ int show_mem_usage(void)
 	if (!initial())
 		return FALSE;
 
+	if (!open_dump_bitmap())
+		return FALSE;
+
 	if (!prepare_bitmap_buffer())
 		return FALSE;
 
-- 
2.9.2


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  parent reply	other threads:[~2016-08-10 12:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10 12:56 [PATCH 0/3] makedumpfile: fix segfault with -X in XEN environment Martin Wilck
2016-08-10 12:56 ` [PATCH 1/3] open_dump_bitmap: open bitmap file in non-cyclic case Martin Wilck
2016-08-10 12:56 ` Martin Wilck [this message]
2016-08-10 12:56 ` [PATCH 3/3] close_dump_bitmap: simplify logic Martin Wilck
2016-08-10 13:08   ` Petr Tesarik
2016-08-10 13:35     ` Martin Wilck
2016-08-16  0:37       ` Atsushi Kumagai
2016-08-16  5:59         ` Petr Tesarik
2016-08-17  7:37           ` Martin Wilck
2016-09-06  8:22             ` [PATCH] Cleanup: Use a negative number for uninitialized file descriptors Petr Tesarik
2016-09-09  6:27               ` Atsushi Kumagai
2016-09-09  7:31                 ` Petr Tesarik
2016-09-09  8:11                   ` [PATCH v2] " Petr Tesarik
2016-09-12  8:17                     ` Atsushi Kumagai
2016-09-14 10:17                       ` [PATCH v2 1/3] open_dump_bitmap: open bitmap file in non-cyclic case Martin Wilck
2016-09-14 10:17                         ` [PATCH v2 2/3] move call to open_dump_bitmap() to after call to initial() Martin Wilck
2016-09-14 10:17                         ` [PATCH v2 3/3] close_dump_bitmap: simplify logic Martin Wilck
2016-09-14 11:50                           ` [PATCH v3 " Martin Wilck
2016-09-20  9:43                             ` Atsushi Kumagai
2016-09-20 10:31                               ` Martin Wilck
2016-09-20 10:33                               ` [PATCH v3 1/3] open_dump_bitmap: open bitmap file in non-cyclic case Martin Wilck
2016-09-20 10:33                                 ` [PATCH v3 2/3] move call to open_dump_bitmap() to after call to initial() Martin Wilck
2016-09-20 10:33                                 ` [PATCH v3 3/3] close_dump_bitmap: simplify logic Martin Wilck
2016-09-21  6:29                                 ` [PATCH v3 1/3] open_dump_bitmap: open bitmap file in non-cyclic case Atsushi Kumagai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160810125658.23366-3-mwilck@suse.de \
    --to=mwilck@suse.de \
    --cc=ats-kumagai@wm.jp.nec.com \
    --cc=kexec@lists.infradead.org \
    --cc=ptesarik@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.