From 2a585ebca2a23c536520d854749fc6a813e9b12a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 1 Mar 2011 23:19:19 +1030 Subject: [PATCH] tdb2: restore file filling code. This snuck in fe55330a which added the stats attribute. Without it, TDB works but is vulnerable to segmenation faults or write errors when disk is exhausted. --- ccan/tdb2/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccan/tdb2/io.c b/ccan/tdb2/io.c index dffd0885..f326d98b 100644 --- a/ccan/tdb2/io.c +++ b/ccan/tdb2/io.c @@ -404,7 +404,7 @@ static int tdb_expand_file(struct tdb_context *tdb, tdb_len_t addition) file isn't sparse, which would be very bad if we ran out of disk. This must be done with write, not via mmap */ memset(buf, 0x43, sizeof(buf)); - if (0 || fill(tdb, buf, sizeof(buf), tdb->map_size, addition) == -1) + if (fill(tdb, buf, sizeof(buf), tdb->map_size, addition) == -1) return -1; tdb->map_size += addition; tdb_mmap(tdb); -- 2.39.2