s3:registry: update the seqnum in the subkey cache at the end of regval_store_keys
authorMichael Adam <obnox@samba.org>
Wed, 11 Apr 2012 14:02:44 +0000 (16:02 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 10 May 2012 09:15:30 +0000 (11:15 +0200)
The purpose is to prevent next reads from going to disk.

Note that this will currently only be effective with local tdbs, not
with ctdb: For tdb, store and delete bump the seqnum while transaction
commit does not. For ctdb, transaction commit bumps the seqnum, while
store and delete don't... This needs fixing (in ctdb).
(cherry picked from commit 16d83149c1b5620598edd37bbd1a73bebec82b6e)

source3/registry/reg_backend_db.c

index aaa2241997ac7d83956412458fabedbfeb2f7369..e0fe7c121151b23f70293f155de2c6ba788b4aa5 100644 (file)
@@ -984,7 +984,11 @@ static NTSTATUS regdb_store_keys_action(struct db_context *db,
                TALLOC_FREE(path);
        }
 
-       werr = WERR_OK;
+       /*
+        * Update the seqnum in the container to possibly
+        * prevent next read from going to disk
+        */
+       werr = regsubkey_ctr_set_seqnum(store_ctx->ctr, db->get_seqnum(db));
 
 done:
        talloc_free(mem_ctx);