Chromium Code Reviews| Index: drivers/md/dm-bht.c |
| diff --git a/drivers/md/dm-bht.c b/drivers/md/dm-bht.c |
| index 46b03c09702bd31ad8319228c24112164c31cac7..e83985e6de714a3c84d5ad0d78541813632cb929 100644 |
| --- a/drivers/md/dm-bht.c |
| +++ b/drivers/md/dm-bht.c |
| @@ -693,10 +693,9 @@ static int dm_bht_verify_path(struct dm_bht *bht, unsigned int block_index) |
| DMDEBUG("verify_path for b=%u on d=%d", block_index, depth); |
| state = atomic_read(&entry->state); |
| if (state == DM_BHT_ENTRY_VERIFIED) { |
| - DMDEBUG("verify_path node %u is verified in parent", |
| + DMDEBUG("verify_path node %u is verified to root", |
| block_index); |
| - entry = dm_bht_get_entry(bht, --depth, block_index); |
| - continue; |
| + break; |
|
Will Drewry
2011/03/10 22:42:50
Nice! I *think* this works :)
You're going to wan
|
| } else if (state <= DM_BHT_ENTRY_ERROR) { |
| DMCRIT("entry(d=%u,b=%u) is in an error state: %d", |
| depth, block_index, state); |
| @@ -726,12 +725,15 @@ static int dm_bht_verify_path(struct dm_bht *bht, unsigned int block_index) |
| goto mismatch; |
| } |
| + entry = parent; |
| + depth--; |
| + } |
| + /* Mark path to leaf as verified. */ |
| + for (; depth < bht->depth; depth++) { |
|
Will Drewry
2011/03/10 22:42:50
Interesting tradeoffs here. If we did root-to-lea
|
| + entry = dm_bht_get_entry(bht, depth, block_index); |
| atomic_cmpxchg(&entry->state, |
| DM_BHT_ENTRY_READY, |
| DM_BHT_ENTRY_VERIFIED); |
| - |
| - entry = parent; |
| - depth--; |
| } |
| return 0; |