diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-12-05 17:03:19 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-12-05 17:03:19 +1030 |
commit | d5524222a42a9dd92f9ea25ced4b70d2a8da1b23 (patch) | |
tree | f9374efa13d08d9e888f5e9a480c3a3376c4e047 /lib/tdb2/test/layout.c | |
parent | 71384d5d75895d39ec3387b18ef7993173aab91e (diff) | |
download | samba-d5524222a42a9dd92f9ea25ced4b70d2a8da1b23.tar.gz samba-d5524222a42a9dd92f9ea25ced4b70d2a8da1b23.tar.bz2 samba-d5524222a42a9dd92f9ea25ced4b70d2a8da1b23.zip |
tdb2: fix intermittant failure in run-50-multiple-freelists-fail.c
layout.c's TDB creation functions were incorrect in case of a hash
collision, causing occasional failure. Make it always use the
(previously-failing) seed value, and fix it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 60a487d57979e4364e70c837079f3cf083ddc9c7)
Diffstat (limited to 'lib/tdb2/test/layout.c')
-rw-r--r-- | lib/tdb2/test/layout.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/tdb2/test/layout.c b/lib/tdb2/test/layout.c index 4f66e0935f..95cca6a810 100644 --- a/lib/tdb2/test/layout.c +++ b/lib/tdb2/test/layout.c @@ -206,7 +206,7 @@ static void add_to_hashtable(struct tdb_context *tdb, b_off = hbucket_off(group_start, bucket); if (tdb_read_off(tdb, b_off) == 0) { tdb_write_off(tdb, b_off, - encode_offset(eoff, bucket, h)); + encode_offset(eoff, in_group, h)); return; } } @@ -228,7 +228,8 @@ static struct tle_freetable *find_ftable(struct tdb_layout *layout, unsigned num } /* FIXME: Support TDB_CONVERT */ -struct tdb_context *tdb_layout_get(struct tdb_layout *layout) +struct tdb_context *tdb_layout_get(struct tdb_layout *layout, + union tdb_attribute *attr) { unsigned int i; tdb_off_t off, len, last_ftable; @@ -264,7 +265,7 @@ struct tdb_context *tdb_layout_get(struct tdb_layout *layout) /* Fill with some weird pattern. */ memset(mem, 0x99, off); /* Now populate our header, cribbing from a real TDB header. */ - tdb = tdb_open(NULL, TDB_INTERNAL, O_RDWR, 0, &tap_log_attr); + tdb = tdb_open(NULL, TDB_INTERNAL, O_RDWR, 0, attr); memcpy(mem, tdb->file->map_ptr, sizeof(struct tdb_header)); /* Mug the tdb we have to make it use this. */ |