The branch, master has been updated
       via  8441c03ccf8 lib:ldb: Print a debug message in case we have a 
corrupted MDB
       via  240c031e7fa lib:ldb: Add the location to ldb_kv_parse_data_unpack() 
debug output
      from  238056e5aad ctdb-scripts: Avoid using testparm to process its own 
output

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 8441c03ccf8f946f3e76dfa92245d0192702b205
Author: Andreas Schneider <a...@samba.org>
Date:   Tue Feb 14 16:31:18 2023 +0100

    lib:ldb: Print a debug message in case we have a corrupted MDB
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz>
    
    Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org>
    Autobuild-Date(master): Wed Feb 15 09:05:56 UTC 2023 on atb-devel-224

commit 240c031e7fa65aecb8276b5385c27651a89afa8d
Author: Andreas Schneider <a...@samba.org>
Date:   Tue Feb 14 16:30:36 2023 +0100

    lib:ldb: Add the location to ldb_kv_parse_data_unpack() debug output
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz>

-----------------------------------------------------------------------

Summary of changes:
 lib/ldb/ldb_key_value/ldb_kv_search.c | 3 ++-
 lib/ldb/ldb_mdb/ldb_mdb.c             | 8 ++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/ldb_key_value/ldb_kv_search.c 
b/lib/ldb/ldb_key_value/ldb_kv_search.c
index 46031b99c16..964e1c1aba0 100644
--- a/lib/ldb/ldb_key_value/ldb_kv_search.c
+++ b/lib/ldb/ldb_key_value/ldb_kv_search.c
@@ -158,7 +158,8 @@ static int ldb_kv_parse_data_unpack(struct ldb_val key,
                        talloc_free(data_parse.data);
                }
 
-               ldb_debug(ldb, LDB_DEBUG_ERROR, "Invalid data for index 
%*.*s\n",
+               ldb_debug(ldb, LDB_DEBUG_ERROR,
+                         __location__ ": Invalid data for index %*.*s\n",
                          (int)key.length, (int)key.length, key.data);
                return LDB_ERR_OPERATIONS_ERROR;
        }
diff --git a/lib/ldb/ldb_mdb/ldb_mdb.c b/lib/ldb/ldb_mdb/ldb_mdb.c
index c163321d5a7..c4c53015b4b 100644
--- a/lib/ldb/ldb_mdb/ldb_mdb.c
+++ b/lib/ldb/ldb_mdb/ldb_mdb.c
@@ -414,6 +414,14 @@ static int lmdb_parse_record(struct ldb_kv_private *ldb_kv,
                if (lmdb->error == MDB_NOTFOUND) {
                        return LDB_ERR_NO_SUCH_OBJECT;
                }
+               if (lmdb->error == MDB_CORRUPTED) {
+                       ldb_debug(lmdb->ldb, LDB_DEBUG_ERROR,
+                               __location__
+                               ": MDB corrupted for key [%*.*s]\n",
+                               (int)key.length,
+                               (int)key.length,
+                               key.data);
+               }
                return ldb_mdb_error(lmdb->ldb, lmdb->error);
        }
        data.data = mdb_data.mv_data;


-- 
Samba Shared Repository

Reply via email to