summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp/ltp
diff options
context:
space:
mode:
authorHongzhi.Song <hongzhi.song@windriver.com>2019-07-01 02:47:46 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-02 08:13:07 +0100
commit4cbe4cbdc0e6f05ec572e2f8813b0551b3026b03 (patch)
treed4ef149593e2eb17625b90f1ae856d2a11d9de0b /meta/recipes-extended/ltp/ltp
parent41e7ba16abae9aace26730e5113f57e52477087e (diff)
downloadpoky-4cbe4cbdc0e6f05ec572e2f8813b0551b3026b03.tar.gz
ltp: diotest4: Let kernel pick an address when calling mmap
Error: diotest4 10 TBROK : diotest4.c:368: can't mmap file: Invalid argument diotest4 11 TBROK : diotest4.c:368: Remaining cases broken This is because the manually specified addr from mmap is invalid. We should let kernel itself pick an addrress. (From OE-Core rev: c49e4fd1cc573170fd18c2f6313f8d77f5e68470) Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/ltp/ltp')
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch b/meta/recipes-extended/ltp/ltp/0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch
new file mode 100644
index 0000000000..620027bd0d
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-diotest4-Let-kernel-pick-an-address-when-calling-mma.patch
@@ -0,0 +1,49 @@
1From 785809201ad7dea2872d493efbfd65bb215710d6 Mon Sep 17 00:00:00 2001
2From: "Hongzhi.Song" <hongzhi.song@windriver.com>
3Date: Sun, 30 Jun 2019 21:56:16 -0400
4Subject: [PATCH] diotest4: Let kernel pick an address when calling mmap
5
6Error:
7diotest4 10 TBROK : diotest4.c:368: can't mmap file: Invalid argument
8diotest4 11 TBROK : diotest4.c:368: Remaining cases broken
9
10This is because the specified addr from mmap is invalid.
11We should let kernel itself pick an addrress.
12
13Signed-off-by: Jan Stancek <jstancek@redhat.com>
14
15Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2019-June/012570.html]
16
17Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
18---
19 testcases/kernel/io/direct_io/diotest4.c | 8 ++------
20 1 file changed, 2 insertions(+), 6 deletions(-)
21
22diff --git a/testcases/kernel/io/direct_io/diotest4.c b/testcases/kernel/io/direct_io/diotest4.c
23index e4616e4..d88c431 100644
24--- a/testcases/kernel/io/direct_io/diotest4.c
25+++ b/testcases/kernel/io/direct_io/diotest4.c
26@@ -352,18 +352,14 @@ int main(int argc, char *argv[])
27 total++;
28
29 /* Test-10: read, write to a mmaped file */
30- shm_base = (char *)(((long)sbrk(0) + (shmsz - 1)) & ~(shmsz - 1));
31- if (shm_base == NULL) {
32- tst_brkm(TBROK, cleanup, "sbrk failed: %s", strerror(errno));
33- }
34 offset = 4096;
35 count = bufsize;
36 if ((fd = open(filename, O_DIRECT | O_RDWR)) < 0) {
37 tst_brkm(TBROK, cleanup, "can't open %s: %s",
38 filename, strerror(errno));
39 }
40- shm_base = mmap(shm_base, 0x100000, PROT_READ | PROT_WRITE,
41- MAP_SHARED | MAP_FIXED, fd, 0);
42+ shm_base = mmap(NULL, 0x100000, PROT_READ | PROT_WRITE,
43+ MAP_SHARED, fd, 0);
44 if (shm_base == (caddr_t) - 1) {
45 tst_brkm(TBROK, cleanup, "can't mmap file: %s",
46 strerror(errno));
47--
482.8.1
49