tdb2: allow readonly changes even while holding locks.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 20 Sep 2011 02:32:43 +0000 (12:02 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 20 Sep 2011 07:35:10 +0000 (09:35 +0200)
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 <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 24e5ddb143fb5e79112649472258f5da67cc7362)

Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Tue Sep 20 09:35:10 CEST 2011 on sn-devel-104

lib/tdb2/tdb.c

index 944781692c7cc3ff04e5c7926c9bc517d4c04ad9..6f38244352cd5665fbe3eb5286ea846e6dc7b246 100644 (file)
@@ -369,16 +369,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;
 }