From: Michael Adam Date: Wed, 11 Apr 2012 14:02:44 +0000 (+0200) Subject: s3:registry: update the seqnum in the subkey cache at the end of regval_store_keys X-Git-Tag: samba-4.0.0alpha20~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab83005b30c621230db674faa1d123f44c9122e7;p=thirdparty%2Fsamba.git s3:registry: update the seqnum in the subkey cache at the end of regval_store_keys 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). Signed-off-by: Andreas Schneider --- diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index d4f52b7571a..65355aec237 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -1260,7 +1260,11 @@ static NTSTATUS regdb_store_keys_action(struct db_context *db, W_ERROR_NOT_OK_GOTO_DONE(werr); } - 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, dbwrap_get_seqnum(db)); done: talloc_free(mem_ctx);