From ab4c69f302ab905bab4266ff9bbfe6c325199864 Mon Sep 17 00:00:00 2001 From: armink Date: Sun, 15 Oct 2023 11:46:28 +0800 Subject: [PATCH] [fdb] Improve the fdb_kv_iterate. Only crc check OK kv will be iterated. --- src/fdb_kvdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fdb_kvdb.c b/src/fdb_kvdb.c index 7c954dd..5680383 100644 --- a/src/fdb_kvdb.c +++ b/src/fdb_kvdb.c @@ -1833,7 +1833,7 @@ bool fdb_kv_iterate(fdb_kvdb_t db, fdb_kv_iterator_t itr) } do { read_kv(db, kv); - if (kv->status == FDB_KV_WRITE) { + if (kv->status == FDB_KV_WRITE && kv->crc_is_ok == true) { /* We got a valid kv here. */ /* If iterator statistics is needed */ itr->iterated_cnt++;