Commit 2a585ebc authored by Rusty Russell's avatar Rusty Russell

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.
parent 850c5cfe
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment