diff options
author | Hongzhi.Song <hongzhi.song@windriver.com> | 2019-06-27 01:23:06 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-06-28 13:28:37 +0100 |
commit | b96d6e2f9b46a6dcdde8e6c4661862feb44bef59 (patch) | |
tree | da43b8b01f0a321d3e099bfadd22aa0b12ea674a /meta/recipes-extended | |
parent | ffbd8bd4ca1b651701a44f92f3c8e735c99132c0 (diff) | |
download | poky-b96d6e2f9b46a6dcdde8e6c4661862feb44bef59.tar.gz |
ltp: fix shmctl01 failure when executed.
schmctl01 fails with following error:
[shmctl01 5 TFAIL : shmctl01.c:171: shmctl01 call failed - errno =
22 : Invalid argument]
Backport the patch from upstream can fix it.
(From OE-Core rev: 337e6923375e7cf568a66b299b6c3461f33a903c)
Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r-- | meta/recipes-extended/ltp/ltp/0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch | 81 | ||||
-rw-r--r-- | meta/recipes-extended/ltp/ltp_20190115.bb | 1 |
2 files changed, 82 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch b/meta/recipes-extended/ltp/ltp/0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch new file mode 100644 index 0000000000..d837f073a9 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | From db0a43d9388be2c347a8306751bbe6bec086d062 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jan Stancek <jstancek@redhat.com> | ||
3 | Date: Mon, 20 May 2019 20:47:20 +0200 | ||
4 | Subject: [PATCH] shmctl01: don't use hardcoded index == 0 for SHM_STAT test | ||
5 | |||
6 | Test fails on SHM_STAT testcase: | ||
7 | shmctl01 5 TFAIL : shmctl01.c:173: shmctl01 call failed | ||
8 | errno = 22 : Invalid argument | ||
9 | shmctl(0, SHM_STAT, 0x601060) = -EINVAL | ||
10 | |||
11 | since following commit: | ||
12 | commit 99db46ea292780cd978d56932d9445b1e8bdafe8 | ||
13 | Author: Manfred Spraul <manfred@colorfullife.com> | ||
14 | Date: Tue May 14 15:46:36 2019 -0700 | ||
15 | ipc: do cyclic id allocation for the ipc object. | ||
16 | |||
17 | Don't rely on index 0 being always available, but instead | ||
18 | use (maximum) index returned by SHM_INFO. | ||
19 | |||
20 | Signed-off-by: Jan Stancek <jstancek@redhat.com> | ||
21 | Reviewed-by: Petr Vorel <pvorel@suse.cz> | ||
22 | Acked-by: Cyril Hrubis <chrubis@suse.cz> | ||
23 | |||
24 | Upstream-Status: Backport from v20190517 | ||
25 | [https://lists.linux.it/pipermail/ltp/2019-May/012051.html] | ||
26 | |||
27 | Signed-off-by: Hongzhi Song <hongzhi.song@windriver.com> | ||
28 | --- | ||
29 | testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | 21 ++++++++++++++++++--- | ||
30 | 1 file changed, 18 insertions(+), 3 deletions(-) | ||
31 | |||
32 | diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | ||
33 | index 1b46977..52bf23a 100644 | ||
34 | --- a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | ||
35 | +++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | ||
36 | @@ -79,6 +79,7 @@ static void func_info(int ret); | ||
37 | |||
38 | /* Check routine for SHM_STAT */ | ||
39 | static void func_sstat(int ret); | ||
40 | +static void func_sstat_setup(void); | ||
41 | |||
42 | /* Check routine for SHM_LOCK */ | ||
43 | static void func_lock(int ret); | ||
44 | @@ -110,7 +111,7 @@ static struct test_case_t { | ||
45 | #endif | ||
46 | {&shm_id_1, IPC_SET, &buf, func_set, set_setup}, | ||
47 | {&shm_id_1, IPC_INFO, (struct shmid_ds *) &info, func_info, NULL}, | ||
48 | - {&shm_index, SHM_STAT, &buf, func_sstat, NULL}, | ||
49 | + {&shm_index, SHM_STAT, &buf, func_sstat, func_sstat_setup}, | ||
50 | {&shm_id_1, SHM_LOCK, NULL, func_lock, NULL}, | ||
51 | {&shm_id_1, SHM_UNLOCK, NULL, func_unlock, NULL}, | ||
52 | {&shm_id_1, IPC_RMID, NULL, func_rmid, NULL}, | ||
53 | @@ -407,9 +408,23 @@ static void func_info(int ret) | ||
54 | static void func_sstat(int ret) | ||
55 | { | ||
56 | if (ret >= 0) | ||
57 | - tst_resm(TPASS, "get correct shared memory id"); | ||
58 | + tst_resm(TPASS, "get correct shared memory id for index: %d", | ||
59 | + shm_index); | ||
60 | else | ||
61 | - tst_resm(TFAIL, "shared memory id is incorrect"); | ||
62 | + tst_resm(TFAIL, "shared memory id is incorrect, index: %d", | ||
63 | + shm_index); | ||
64 | +} | ||
65 | + | ||
66 | +static void func_sstat_setup(void) | ||
67 | +{ | ||
68 | + struct shm_info tmp; | ||
69 | + int ret; | ||
70 | + | ||
71 | + ret = shmctl(shm_id_1, SHM_INFO, (void *)&tmp); | ||
72 | + if (ret < 0) | ||
73 | + tst_resm(TFAIL|TERRNO, "shmctl(SHM_INFO)"); | ||
74 | + else | ||
75 | + shm_index = ret; | ||
76 | } | ||
77 | |||
78 | static void func_lock(int ret) | ||
79 | -- | ||
80 | 2.8.1 | ||
81 | |||
diff --git a/meta/recipes-extended/ltp/ltp_20190115.bb b/meta/recipes-extended/ltp/ltp_20190115.bb index 1d0c00b64b..e91dea2f19 100644 --- a/meta/recipes-extended/ltp/ltp_20190115.bb +++ b/meta/recipes-extended/ltp/ltp_20190115.bb | |||
@@ -50,6 +50,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ | |||
50 | file://define-sigrtmin-and-sigrtmax-for-musl.patch \ | 50 | file://define-sigrtmin-and-sigrtmax-for-musl.patch \ |
51 | file://setregid01-security-string-formatting.patch \ | 51 | file://setregid01-security-string-formatting.patch \ |
52 | file://0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch \ | 52 | file://0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch \ |
53 | file://0001-shmctl01-don-t-use-hardcoded-index-0-for-SHM_STAT-te.patch \ | ||
53 | " | 54 | " |
54 | 55 | ||
55 | S = "${WORKDIR}/git" | 56 | S = "${WORKDIR}/git" |