From 52539b7b43667fb64f5358a32b022e2205e23baf Mon Sep 17 00:00:00 2001 From: Chunsheng Luo Date: Wed, 9 Nov 2022 21:26:42 +0800 Subject: [PATCH] delete unused patches (cherry picked from commit 651faa1eca3695ef77c181388cf79c97811fc1ad) --- ...segmentation-fault-when-using-offset.patch | 44 ------------------- 0002-fix-verify_shm-memcmp-nodes.patch | 25 ----------- numactl.spec | 5 ++- 3 files changed, 4 insertions(+), 70 deletions(-) delete mode 100644 0001-Fix-segmentation-fault-when-using-offset.patch delete mode 100644 0002-fix-verify_shm-memcmp-nodes.patch diff --git a/0001-Fix-segmentation-fault-when-using-offset.patch b/0001-Fix-segmentation-fault-when-using-offset.patch deleted file mode 100644 index 9838c2e..0000000 --- a/0001-Fix-segmentation-fault-when-using-offset.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 53797364e07e67555ec3b139cf3c3563c7035c11 Mon Sep 17 00:00:00 2001 -From: Chunsheng Luo -Date: Wed, 8 Sep 2021 17:18:53 +0800 -Subject: [PATCH] shm.c: Fix segmentation fault when using offset - -The following command can trigger the bug - numactl --offset 4096 --length 65536 --file xxx -p0 --touch - -When we create a shm file, we just consider shmlen, but not consider shmoffset, -resulting in the mapped memory is no within the scope of the new shm file. ---- - shm.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/shm.c b/shm.c -index e5192e5..324cfbe 100644 ---- a/shm.c -+++ b/shm.c -@@ -107,8 +107,8 @@ void attach_sysvshm(char *name, char *opt) - "need a --length to create a sysv shared memory segment"); - fprintf(stderr, - "numactl: Creating shared memory segment %s id %ld mode %04o length %.fMB\n", -- name, shmid, shmmode, ((double)shmlen) / (1024*1024) ); -- shmfd = shmget(key, shmlen, IPC_CREAT|shmmode|shmflags); -+ name, shmid, shmmode, ((double)(shmlen + shmoffset)) / (1024*1024) ); -+ shmfd = shmget(key, shmlen + shmoffset, IPC_CREAT|shmmode|shmflags); - if (shmfd < 0) - nerror("cannot create shared memory segment"); - } -@@ -145,8 +145,12 @@ void attach_shared(char *name, char *opt) - } - if (fstat64(shmfd, &st) < 0) - err("shm stat"); -- if (shmlen > st.st_size) { -- if (ftruncate64(shmfd, shmlen) < 0) { -+ /* the file size must be larger than mmap shmlen + shmoffset, otherwise SIGBUS -+ * will be caused when we access memory, because mmaped memory is no longer in -+ * the range of the file laster. -+ */ -+ if ((shmlen + shmoffset) > st.st_size) { -+ if (ftruncate64(shmfd, shmlen + shmoffset) < 0) { - /* XXX: we could do it by hand, but it would it - would be impossible to apply policy then. - need to fix that in the kernel. */ diff --git a/0002-fix-verify_shm-memcmp-nodes.patch b/0002-fix-verify_shm-memcmp-nodes.patch deleted file mode 100644 index a1b9b55..0000000 --- a/0002-fix-verify_shm-memcmp-nodes.patch +++ /dev/null @@ -1,25 +0,0 @@ -From c833565be79f2ef2541459f2d8444894abd9d939 Mon Sep 17 00:00:00 2001 -From: Chunsheng Luo -Date: Wed, 8 Sep 2021 18:10:53 +0800 -Subject: [PATCH] shm.c: fix verify_shm memcmp nodes - -When nodemask_sz is large 64 (CONFIG_NODES_SHIFT > 6), verify_shm -will output wrong result "mismatched node mask". that's not what we -expected, we expected compare nodes->maskp. ---- - shm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/shm.c b/shm.c -index 324cfbe..3cf3d2b 100644 ---- a/shm.c -+++ b/shm.c -@@ -295,7 +295,7 @@ void verify_shm(int policy, struct bitmask *nodes) - policy_name(pol2), policy_name(policy)); - return; - } -- if (memcmp(nodes2, nodes, numa_bitmask_nbytes(nodes))) { -+ if (memcmp(nodes2->maskp, nodes->maskp, numa_bitmask_nbytes(nodes))) { - vwarn(p, "mismatched node mask\n"); - printmask("expected", nodes); - printmask("real", nodes2); diff --git a/numactl.spec b/numactl.spec index 20bd2a1..8cce0cd 100644 --- a/numactl.spec +++ b/numactl.spec @@ -1,6 +1,6 @@ Name: numactl Version: 2.0.16 -Release: 1 +Release: 2 Summary: Library for tuning for Non Uniform Memory Access machines License: GPLv2 URL: https://github.com/numactl/numactl @@ -74,6 +74,9 @@ LD_LIBRARY_PATH=$(pwd)/.libs make check %{_mandir}/man3/*.3* %changelog +* Wed Nov 9 2022 Chunsheng Luo - 2.0.16-2 +- delete unused patches + * Wed Nov 9 2022 Chunsheng Luo - 2.0.16-1 - update version to 2.0.16 -- Gitee