summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/ltp/ltp/0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch70
-rw-r--r--meta/recipes-extended/ltp/ltp_20190115.bb1
2 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch b/meta/recipes-extended/ltp/ltp/0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch
new file mode 100644
index 0000000000..39623c37d8
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-syscalls-setrlimit03.c-read-proc-sys-fs-nr_open-for-.patch
@@ -0,0 +1,70 @@
1From db57ddc1497e72947da2b14f471ab521478ef99d Mon Sep 17 00:00:00 2001
2From: Tommi Rantala <tommi.t.rantala@nokia.com>
3Date: Thu, 31 Jan 2019 19:49:00 +0200
4Subject: [PATCH] syscalls/setrlimit03.c: read /proc/sys/fs/nr_open for
5 RLIMIT_NOFILE limit
6
7Since kernel v2.6.25 RLIMIT_NOFILE limit is no longer hardcoded to
8NR_OPEN, but can be set via /proc/sys/fs/nr_open, see kernel commit
99cfe015aa424b3c003baba3841a60dd9b5ad319b ("get rid of NR_OPEN and
10introduce a sysctl_nr_open").
11
12nr_open default value is 1024*1024, so setrlimit03 has been passing fine
13on new kernels, only "unexpectedly succeeding" if nr_open is set to some
14larger value.
15
16Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>
17Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
18
19Upstream-Status: Backport [db57ddc1497e ("syscalls/setrlimit03.c: read /proc/sys/fs/nr_open for RLIMIT_NOFILE limit")]
20
21Signed-off-by: He Zhe <zhe.he@windriver.com>
22---
23 testcases/kernel/syscalls/setrlimit/setrlimit03.c | 13 +++++++++++--
24 1 file changed, 11 insertions(+), 2 deletions(-)
25
26diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit03.c b/testcases/kernel/syscalls/setrlimit/setrlimit03.c
27index 29b52aa..12455fe 100644
28--- a/testcases/kernel/syscalls/setrlimit/setrlimit03.c
29+++ b/testcases/kernel/syscalls/setrlimit/setrlimit03.c
30@@ -35,7 +35,10 @@
31 # define NR_OPEN (1024*1024)
32 #endif
33
34+#define NR_OPEN_PATH "/proc/sys/fs/nr_open"
35+
36 static struct rlimit rlim1, rlim2;
37+static unsigned int nr_open = NR_OPEN;
38
39 static struct tcase {
40 struct rlimit *rlimt;
41@@ -51,7 +54,10 @@ static void verify_setrlimit(unsigned int n)
42
43 TEST(setrlimit(RLIMIT_NOFILE, tc->rlimt));
44 if (TST_RET != -1) {
45- tst_res(TFAIL, "call succeeded unexpectedly");
46+ tst_res(TFAIL, "call succeeded unexpectedly "
47+ "(nr_open=%u rlim_cur=%lu rlim_max=%lu)", nr_open,
48+ (unsigned long)(tc->rlimt->rlim_cur),
49+ (unsigned long)(tc->rlimt->rlim_max));
50 return;
51 }
52
53@@ -65,10 +71,13 @@ static void verify_setrlimit(unsigned int n)
54
55 static void setup(void)
56 {
57+ if (!access(NR_OPEN_PATH, F_OK))
58+ SAFE_FILE_SCANF(NR_OPEN_PATH, "%u", &nr_open);
59+
60 SAFE_GETRLIMIT(RLIMIT_NOFILE, &rlim1);
61 rlim2.rlim_max = rlim1.rlim_cur;
62 rlim2.rlim_cur = rlim1.rlim_max + 1;
63- rlim1.rlim_max = NR_OPEN + 1;
64+ rlim1.rlim_max = nr_open + 1;
65 }
66
67 static struct tst_test test = {
68--
692.7.4
70
diff --git a/meta/recipes-extended/ltp/ltp_20190115.bb b/meta/recipes-extended/ltp/ltp_20190115.bb
index ddf97e26ce..1d0c00b64b 100644
--- a/meta/recipes-extended/ltp/ltp_20190115.bb
+++ b/meta/recipes-extended/ltp/ltp_20190115.bb
@@ -49,6 +49,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \
49 file://0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \ 49 file://0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \
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 " 53 "
53 54
54S = "${WORKDIR}/git" 55S = "${WORKDIR}/git"