Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1599)

Unified Diff: drivers/md/dm-bht.c

Issue 6246094: CHROMIUM: verity: add BUG in check_block for consistency with verify_path (Closed) Base URL: http://git.chromium.org/git/kernel.git@master
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: drivers/md/dm-bht.c
diff --git a/drivers/md/dm-bht.c b/drivers/md/dm-bht.c
index bc662cbd188500158fc6e1691c38f3110c285101..775a5e4be3a11204f4cae2df076382043a902374 100644
--- a/drivers/md/dm-bht.c
+++ b/drivers/md/dm-bht.c
@@ -615,17 +615,10 @@ static int dm_bht_check_block(struct dm_bht *bht, unsigned int block_index,
index = block_index >> bht->node_count_shift;
entry = &bht->levels[depth].entries[index];
- *entry_state = atomic_read(&entry->state);
- if (*entry_state <= DM_BHT_ENTRY_ERROR) {
- DMCRIT("leaf entry for block %u is invalid",
- block_index);
- return *entry_state;
- }
- if (*entry_state <= DM_BHT_ENTRY_PENDING) {
- DMERR("leaf data not yet loaded for block %u",
- block_index);
- return 1;
- }
+ /* This call is only safe if all nodes along the path
+ * are already populated (i.e. READY) via dm_bht_populate.
+ */
+ BUG_ON(atomic_read(&entry->state) < DM_BHT_ENTRY_READY);
/* Index into the entry data */
index = (block_index % bht->node_count) * bht->digest_size;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698