]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/lock.c
tdb2: fix leak on lock failure during open.
[ccan] / ccan / tdb2 / lock.c
index 0b30af54c52bb77ac5a42e1318580114c7ec364a..c503c9a28bb444efa805217d7cd483ae4eed5bed 100644 (file)
@@ -186,7 +186,7 @@ static int tdb_brunlock(struct tdb_context *tdb,
        } while (ret == -1 && errno == EINTR);
 
        if (ret == -1) {
-               tdb_logerr(tdb, TDB_ERR_LOCK, TDB_DEBUG_TRACE,
+               tdb_logerr(tdb, TDB_ERR_LOCK, TDB_DEBUG_ERROR,
                           "tdb_brunlock failed (fd=%d) at offset %zu"
                           " rw_type=%d len=%zu",
                           tdb->fd, (size_t)offset, rw_type, (size_t)len);
@@ -234,7 +234,7 @@ int tdb_allrecord_upgrade(struct tdb_context *tdb)
                tv.tv_usec = 1;
                select(0, NULL, NULL, NULL, &tv);
        }
-       tdb_logerr(tdb, TDB_ERR_LOCK, TDB_DEBUG_WARNING,
+       tdb_logerr(tdb, TDB_ERR_LOCK, TDB_DEBUG_ERROR,
                   "tdb_allrecord_upgrade failed");
        return -1;
 }
@@ -495,12 +495,12 @@ again:
                return -1;
        }
 
-       /* Lock free lists: there to end of file. */
+       /* Lock free tables: there to end of file. */
        if (tdb_brlock(tdb, ltype, TDB_HASH_LOCK_START + TDB_HASH_LOCK_RANGE,
                       0, flags)) {
                if (!(flags & TDB_LOCK_PROBE)) {
                        tdb_logerr(tdb, tdb->ecode, TDB_DEBUG_ERROR,
-                                "tdb_allrecord_lock freelist failed");
+                                "tdb_allrecord_lock freetables failed");
                }
                tdb_brunlock(tdb, ltype, TDB_HASH_LOCK_START, 
                             TDB_HASH_LOCK_RANGE);