]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/tdb1_check.c
tdb2: use tdb->flags & TDB_RDONLY instead of tdb->read_only for TDB1 code.
[ccan] / ccan / tdb2 / tdb1_check.c
index edbfd86bcfe1041168931f6102e014d3e6c58bbf..9097017ea14a0eb36e945093705752e4c3dcb4c2 100644 (file)
@@ -334,9 +334,8 @@ int tdb1_check(struct tdb1_context *tdb,
        tdb1_len_t dead;
        bool locked;
 
-       /* Read-only databases use no locking at all: it's best-effort.
-        * We may have a write lock already, so skip that case too. */
-       if (tdb->read_only || tdb->file->allrecord_lock.count != 0) {
+       /* We may have a write lock already, so don't re-lock. */
+       if (tdb->file->allrecord_lock.count != 0) {
                locked = false;
        } else {
                if (tdb1_lockall_read(tdb) == -1)