Skip to contentSkip to conversation

makdumpfile: clean up the in-accurate message printing about mmap

PATCH In review Baoquan He 2 participants 3 messages Mar 16, 2016 – Mar 17, 2016

Subsystems (2)
lore
Share & tools
lore

Baoquan He

author
#0 lore raw

PATCH 1/1 makdumpfile: clean up the in-accurate message printing about mmap

mmap() is not used either caused by failure of mmap() in initialize_mmap(), or because user explictly specify '--non-mmap'. So the message need be changed according these different cases.

---
 makedumpfile.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
makedumpfile.c +11 -8
index fa0b779..5703369 100644
@@ -3949,14 +3949,17 @@ out:
 	if (info->dump_level & DL_EXCLUDE_FREE)
 		setup_page_is_buddy();
 
-	if (info->flag_usemmap == MMAP_TRY && initialize_mmap()) {
-		DEBUG_MSG("mmap() is available on the kernel.\n");
-		info->flag_usemmap = MMAP_ENABLE;
-	} else {
-		DEBUG_MSG("The kernel doesn't support mmap(),");
-		DEBUG_MSG("read() will be used instead.\n");
-		info->flag_usemmap = MMAP_DISABLE;
-        }
+	if (info->flag_usemmap == MMAP_TRY ) {
+		if (initialize_mmap()) {
+			DEBUG_MSG("mmap() is available on the kernel.\n");
+			info->flag_usemmap = MMAP_ENABLE;
+		} else {
+			DEBUG_MSG("The kernel doesn't support mmap(),");
+			DEBUG_MSG("read() will be used instead.\n");
+			info->flag_usemmap = MMAP_DISABLE;
+		}
+        } else if (info->flag_usemmap == MMAP_DISABLE)
+		DEBUG_MSG("mmap() is disabled by specified option '--non-mmap'.\n");
 
 	return TRUE;
 }
Signature · 7 lines
2.5.0


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Acked-by on v1 1/1
#1 lore raw

Hello Baoquan,

Quoted 5 lines

mmap() is not used either caused by failure of mmap() in initialize_mmap(), or because user explictly specify '--non-mmap'. So the message need be changed according these different cases.

Sounds reasonable, thanks.

Quoted 35 lines

---
makedumpfile.c | 19 +++++++++++--------

1 file changed, 11 insertions(+), 8 deletions(-)
makedumpfile.c +11 -9
index fa0b779..5703369 100644
@@ -3949,14 +3949,17 @@ out:
 	if (info->dump_level & DL_EXCLUDE_FREE)
 		setup_page_is_buddy();
 
-	if (info->flag_usemmap == MMAP_TRY && initialize_mmap()) {
-		DEBUG_MSG("mmap() is available on the kernel.\n");
-		info->flag_usemmap = MMAP_ENABLE;
-	} else {
-		DEBUG_MSG("The kernel doesn't support mmap(),");
-		DEBUG_MSG("read() will be used instead.\n");
-		info->flag_usemmap = MMAP_DISABLE;
-        }
+	if (info->flag_usemmap == MMAP_TRY ) {
+		if (initialize_mmap()) {
+			DEBUG_MSG("mmap() is available on the kernel.\n");
+			info->flag_usemmap = MMAP_ENABLE;
+		} else {
+			DEBUG_MSG("The kernel doesn't support mmap(),");
+			DEBUG_MSG("read() will be used instead.\n");
+			info->flag_usemmap = MMAP_DISABLE;
+		}
+        } else if (info->flag_usemmap == MMAP_DISABLE)
+		DEBUG_MSG("mmap() is disabled by specified option '--non-mmap'.\n");
 
 	return TRUE;
 }
--
Quoted 1 line

2.5.0

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

author
#2 lore raw
Quoted 11 lines · Atsushi Kumagai

Hello Baoquan,

Quoted 5 lines

mmap() is not used either caused by failure of mmap() in initialize_mmap(), or because user explictly specify '--non-mmap'. So the message need be changed according these different cases.

Sounds reasonable, thanks.

Thanks!

Quoted 33 lines
Quoted 33 lines

---
makedumpfile.c | 19 +++++++++++--------

1 file changed, 11 insertions(+), 8 deletions(-)
makedumpfile.c +11 -8
index fa0b779..5703369 100644
@@ -3949,14 +3949,17 @@ out:
 	if (info->dump_level & DL_EXCLUDE_FREE)
 		setup_page_is_buddy();
 
-	if (info->flag_usemmap == MMAP_TRY && initialize_mmap()) {
-		DEBUG_MSG("mmap() is available on the kernel.\n");
-		info->flag_usemmap = MMAP_ENABLE;
-	} else {
-		DEBUG_MSG("The kernel doesn't support mmap(),");
-		DEBUG_MSG("read() will be used instead.\n");
-		info->flag_usemmap = MMAP_DISABLE;
-        }
+	if (info->flag_usemmap == MMAP_TRY ) {
+		if (initialize_mmap()) {
+			DEBUG_MSG("mmap() is available on the kernel.\n");
+			info->flag_usemmap = MMAP_ENABLE;
+		} else {
+			DEBUG_MSG("The kernel doesn't support mmap(),");
+			DEBUG_MSG("read() will be used instead.\n");
+			info->flag_usemmap = MMAP_DISABLE;
+		}
+        } else if (info->flag_usemmap == MMAP_DISABLE)
+		DEBUG_MSG("mmap() is disabled by specified option '--non-mmap'.\n");
 
Quoted 5 lines
Quoted 4 lines
makedumpfile.c +0 -1
 	return TRUE;
 }
--

2.5.0

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec