summaryrefslogtreecommitdiff
path: root/core/gdbm/8952f7fd7cebffbe4ecf8c232e4435c5de72678a.patch
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2021-09-16 09:33:36 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2021-09-16 09:33:36 +0200
commitcbc1374f60bb925489a41ed67598cac6588a01cd (patch)
tree9958ec5c3006c1940c0db0e79dfc39ecef27eeba /core/gdbm/8952f7fd7cebffbe4ecf8c232e4435c5de72678a.patch
parentee81a7767ab9aaaa21db5d319381c507da8d97e5 (diff)
downloadpackages-cbc1374f60bb925489a41ed67598cac6588a01cd.tar.xz
core/gdbm: integrated upstream fix for test 31 (FS32#204)
Diffstat (limited to 'core/gdbm/8952f7fd7cebffbe4ecf8c232e4435c5de72678a.patch')
-rw-r--r--core/gdbm/8952f7fd7cebffbe4ecf8c232e4435c5de72678a.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/core/gdbm/8952f7fd7cebffbe4ecf8c232e4435c5de72678a.patch b/core/gdbm/8952f7fd7cebffbe4ecf8c232e4435c5de72678a.patch
new file mode 100644
index 00000000..c98f721e
--- /dev/null
+++ b/core/gdbm/8952f7fd7cebffbe4ecf8c232e4435c5de72678a.patch
@@ -0,0 +1,31 @@
+From 8952f7fd7cebffbe4ecf8c232e4435c5de72678a Mon Sep 17 00:00:00 2001
+From: Sergey Poznyakoff <gray@gnu.org>
+Date: Thu, 16 Sep 2021 08:45:29 +0300
+Subject: Fix computation of dbf->avail->count after pushing new avail block.
+
+This is a very long-standing bug that caused a loss of an avail
+entry if the original avail table had odd number of entries.
+
+* src/falloc.c (push_avail_block): Fix computation of dbf->avail->count.
+---
+ src/falloc.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/falloc.c b/src/falloc.c
+index 979d77a..890ed7b 100644
+--- a/src/falloc.c
++++ b/src/falloc.c
+@@ -314,8 +314,8 @@ push_avail_block (GDBM_FILE dbf)
+ else
+ dbf->avail->av_table[index>>1] = dbf->avail->av_table[index];
+
+- /* Update the header avail count to previous size divided by 2. */
+- dbf->avail->count >>= 1;
++ /* Update the header avail count. */
++ dbf->avail->count -= temp->count;
+
+ rc = 0;
+ do
+--
+cgit v1.2.1
+