tdb: Improve debugging when the allrecord lock fails to upgrade
[ambi/samba-autobuild/.git] / lib / tdb / common / transaction.c
index 0dd057b..4d08fee 100644 (file)
@@ -982,7 +982,10 @@ static int _tdb_transaction_prepare_commit(struct tdb_context *tdb)
 
        /* upgrade the main transaction lock region to a write lock */
        if (tdb_allrecord_upgrade(tdb) == -1) {
-               TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_transaction_prepare_commit: failed to upgrade hash locks\n"));
+               TDB_LOG((tdb, TDB_DEBUG_ERROR,
+                       "tdb_transaction_prepare_commit: "
+                       "failed to upgrade hash locks: %s\n",
+                        tdb_errorstr(tdb)));
                _tdb_transaction_cancel(tdb);
                return -1;
        }