From 3d82f786ecdd6747e90fe480a15de8c3fcea5f7b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 17 Feb 2013 20:56:34 +1030 Subject: ntdb: fix database corruption when transaction doesn't change anything. ntdb's transaction code has an optimization which tdb's doesnt: it only writes the parts of blocks whose contents have changed. This means we can actually have a transaction which turns out to need no recovery region. This breaks the recovery setup logic, which sets the current recovery size to 0 if there's no recovery area, and assumes that we'll always create a new recovery area since the recovery will always need > 0 bytes. In fact, if we really haven't changed anything, we can skip the transaction commit altogether: since this happens at least once with Samba, it's worth doing. Signed-off-by: Rusty Russell Reviewed-by: Andrew Bartlett --- lib/ntdb/wscript | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/ntdb/wscript') diff --git a/lib/ntdb/wscript b/lib/ntdb/wscript index 1a4b02bb25..63c8402d66 100644 --- a/lib/ntdb/wscript +++ b/lib/ntdb/wscript @@ -72,6 +72,7 @@ def configure(conf): 'test/api-20-alloc-attr.c', 'test/api-21-parse_record.c', 'test/api-55-transaction.c', + 'test/api-60-noop-transaction.c', 'test/api-80-tdb_fd.c', 'test/api-81-seqnum.c', 'test/api-82-lockattr.c', -- cgit