From: Rusty Russell Date: Tue, 20 Sep 2011 02:32:43 +0000 (+0930) Subject: tdb2: allow readonly changes even while holding locks. X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=24e5ddb143fb5e79112649472258f5da67cc7362;ds=sidebyside tdb2: allow readonly changes even while holding locks. This happens in SAMBA with the TDB_VERSION1, presumably due to a read-only traverse nested inside a normal traverse (since it doesn't occur without TDB_VERSION1). Signed-off-by: Rusty Russell --- diff --git a/ccan/tdb2/tdb.c b/ccan/tdb2/tdb.c index e0c7d957..62607bf1 100644 --- a/ccan/tdb2/tdb.c +++ b/ccan/tdb2/tdb.c @@ -367,16 +367,6 @@ static bool readonly_changable(struct tdb_context *tdb, const char *caller) caller); return false; } - - if (tdb->file->allrecord_lock.count != 0 - || tdb->file->num_lockrecs != 0) { - tdb->last_error = tdb_logerr(tdb, TDB_ERR_EINVAL, - TDB_LOG_USE_ERROR, - "%s: can't change" - " TDB_RDONLY holding locks", - caller); - return false; - } return true; }