All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "kexec: use mmap instead of read for slurp_file()"
@ 2015-10-23  3:10 Dave Young
  2015-10-23 15:09 ` Michael Holzheu
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Dave Young @ 2015-10-23  3:10 UTC (permalink / raw)
  To: Simon Horman; +Cc: Michael Holzheu, kexec

This reverts commit 7ab842d8a004f6cd75a9d7b3528e4a70819ce4ef.

using mmap by default in slurp_file cause segment fault while later
reallocing dtb_buf during my arm kexec test.

Signed-off-by: Dave Young <dyoung@redhat.com>
---
 kexec/kexec.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

--- kexec-tools.orig/kexec/kexec.c
+++ kexec-tools/kexec/kexec.c
@@ -26,7 +26,6 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <limits.h>
-#include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/reboot.h>
@@ -553,12 +552,11 @@ char *slurp_file(const char *filename, o
 		if (err < 0)
 			die("Can not seek to the begin of file %s: %s\n",
 					filename, strerror(errno));
-		buf = slurp_fd(fd, filename, size, &nread);
 	} else {
-		size = nread = stats.st_size;
-		buf = mmap(NULL, size,
-			   PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+		size = stats.st_size;
 	}
+
+	buf = slurp_fd(fd, filename, size, &nread);
 	if (!buf)
 		die("Cannot read %s", filename);
 

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-11-09  1:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-23  3:10 [PATCH] Revert "kexec: use mmap instead of read for slurp_file()" Dave Young
2015-10-23 15:09 ` Michael Holzheu
2015-10-26  7:31   ` Dave Young
2015-10-27 12:35     ` [PATCH v2] kexec/s390x: use mmap instead of read for slurp_file() Michael Holzheu
2015-10-28  6:46       ` Dave Young
2015-10-28  9:57         ` Michael Holzheu
2015-10-29  6:37           ` Dave Young
2015-10-29 15:26             ` Michael Holzheu
2015-10-30  2:03               ` Dave Young
2015-10-30 10:13                 ` Michael Holzheu
2015-10-30 13:39                   ` Dave Young
2015-10-30 15:02                     ` [PATCH v3] " Michael Holzheu
2015-11-09  1:59                       ` Simon Horman
2015-10-26  4:30 ` [PATCH] Revert "kexec: use mmap instead of read for slurp_file()" Simon Horman
2015-11-03  0:11 ` Geoff Levand
2015-11-03  1:15   ` Dave Young

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.