- 28 Mar, 2011 1 commit
-
-
Rusty Russell authored
Running speed with --transaction --no-sync means no locking or syncs are done, so we can measure raw TDB speed.
-
- 24 Mar, 2011 2 commits
-
-
Rusty Russell authored
We use "r" after we call tdb_access_release() when we find corruption in the free list. "r" may be a pointer into malloced memory, freed by tdb_access_release().
-
Rusty Russell authored
One but were we didn't update the map_size if we expanded the transaction but didn't create a new recovery area (most easily reproduced by setting the TDB_NOSYNC flag). Another out-by-one bug in transaction_direct where we would give read-access to the underlying file despite the last block having been modified. Both these were found by tdbtorture.
-
- 23 Mar, 2011 1 commit
-
-
Rusty Russell authored
-
- 24 Mar, 2011 1 commit
-
-
Rusty Russell authored
I'm still not sure it'll last into the final version, but finish the implementation.
-
- 23 Mar, 2011 2 commits
-
-
Rusty Russell authored
Samba uses these flags, so be friendly.
-
Rusty Russell authored
-
- 24 Mar, 2011 1 commit
-
-
Rusty Russell authored
tdb1 has tdb_reopen/tdb_reopen_all, which you are supposed to call after a fork(). But we can detect PID changes whenever we grab a lock, which is to say, before we do anything. We currently assume that pread and pwrite work, so the only problem with fork() is if we are holding locks and expect them to still be there in the child. This is unusual, but most likely caused by a fork() inside a transaction. In such cases, allow the child to unlock without complaint; they can then use the TDB as expected. Performance before and after shows no measurable speed difference: Total of 5 runs of tools/speed 100000: Before: Adding: 18899ns Finding: 7040ns Missing: 5802ns Traversing: 6466ns Deleting: 12607ns Re-adding: 14185ns Appending: 20770ns Churning: 93845ns After: Adding: 18073ns Finding: 6795ns Missing: 5549ns Traversing: 6333ns Deleting: 12313ns Re-adding: 13835ns Appending: 20343ns Churning: 92208ns
-
- 22 Mar, 2011 1 commit
-
-
Rusty Russell authored
We also change tdb_chainunlock not to return an error (as per the other locking functions: we log a message, but don't return an error).
-
- 28 Mar, 2011 1 commit
-
-
Rusty Russell authored
This isn't on RHEL4, for example: isascii() and isblank() are not in C89.
-
- 25 Mar, 2011 2 commits
-
-
Rusty Russell authored
I don't quite know why, but this started happening to me. We should handle it anyway.
-
Rusty Russell authored
gcc gave a warning: tools/ccanlint/ccanlint.c:230:19: error: ‘c’ may be used uninitialized in this function Which indicated that test dependency printing was broken: we need to loop through the tests! Also, we haven't parsed options yet, so verbose is never true: move it to later and make it depend on -vvv.
-
- 24 Mar, 2011 1 commit
-
-
David Gibson authored
memmem(), which searches for one bytestring in a longer bytestring is one of those functions that should be standard, but isn't. This patch adds a ccan configurator test for the function so that modules can use or replace it as necessary. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
- 22 Mar, 2011 24 commits
-
-
Rusty Russell authored
Simplest fix is to use const where possible, and use a different var for asprintf and string literals in login.c.
-
Rusty Russell authored
Tests don't compile otherwise, so fix that up (ccanlint now tests with reduced features, so this became clear).
-
Rusty Russell authored
Add a license tag (though it's a weird BSD variant), remove whitespace, and avoid void pointer arithmetic.
-
Rusty Russell authored
They expect to be linked against the module objects.
-
Rusty Russell authored
-
Rusty Russell authored
Just grab the tokens for the simple case: this allows the ccanlint reduce_features test to work on eg. ccan/cast.
-
Rusty Russell authored
This means we change some minor tests to "never fail", eg. whitespace or documentation tests. Note that pass/fail is independent of the score for a test.
-
Rusty Russell authored
-
Rusty Russell authored
-
Rusty Russell authored
-
Rusty Russell authored
-
Rusty Russell authored
Be a little more careful with const.
-
Rusty Russell authored
Shown up by -Wwrite-strings.
-
Rusty Russell authored
Wpointer-arith is useful for spotting GCC-isms which do arithmetic on void pointers. Wwrite-strings treats string constants as const char *, which is sane (but bad for legacy code).
-
Rusty Russell authored
-
Rusty Russell authored
-
Rusty Russell authored
Same fix as we used for ccan/typesafe_cb.
-
Rusty Russell authored
No only does this give us one more ccanlint point, it clears the way to see if we introduce a *real* memory leak later.
-
Rusty Russell authored
This need shows up most clearly with opt_usage_and_exit and gcc's -Wwrite-strings, where string literals become "const char *". Our callbacks should take const void *: since we overload the arg field already (to hold table size) it make sense to turn it into a proper union.
-
Rusty Russell authored
Headers should stand alone; we use NULL, so we should make sure it's defined.
-
Rusty Russell authored
I thought using sizeof() comparison to compare the types was clever, but it doesn't work on void pointers, as sizeof(void) is illegal.
-
Rusty Russell authored
In this case, "work" means "fail to compile cleanly".
-
Rusty Russell authored
-
Rusty Russell authored
-
- 21 Mar, 2011 3 commits
-
-
Rusty Russell authored
-
Rusty Russell authored
Don't implicitly cast away const in the tests.
-
Rusty Russell authored
In particular, avoid doing arithmetic on NULL; decay the function to a pointer using a trinary conditional instead.
-