From 6a95ac8c8a2730c71259763990b4ea1e8ade7fcd Mon Sep 17 00:00:00 2001 From: chwncy Date: Wed, 15 Jun 2022 21:41:20 +0800 Subject: [PATCH] Abandon the verification of the data whose status is deleted --- src/fdb_kvdb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fdb_kvdb.c b/src/fdb_kvdb.c index f479eea..cea224e 100644 --- a/src/fdb_kvdb.c +++ b/src/fdb_kvdb.c @@ -332,6 +332,9 @@ static fdb_err_t read_kv(fdb_kvdb_t db, fdb_kv_t kv) } else if (kv->len > db_sec_size(db) - SECTOR_HDR_DATA_SIZE && kv->len < db_max_size(db)) { //TODO 扇区连续模式,或者写入长度没有写入完整 FDB_ASSERT(0); + } else if (FDB_KV_DELETED == kv->status) { + kv->crc_is_ok = false; + return FDB_READ_ERR; } /* CRC32 data len(header.name_len + header.value_len + name + value) */