Skip to content

Commit 0808ebf

Browse files
raeburnMikulas Patocka
authored andcommitted
dm vdo: don't refer to dedupe_context after releasing it
Clear the dedupe_context pointer in a data_vio whenever ownership of the context is lost, so that vdo can't examine it accidentally. Signed-off-by: Ken Raeburn <[email protected]> Signed-off-by: Matthew Sakai <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 47ac09b commit 0808ebf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/md/dm-vdo/dedupe.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,7 @@ static void process_update_result(struct data_vio *agent)
729729
!change_context_state(context, DEDUPE_CONTEXT_COMPLETE, DEDUPE_CONTEXT_IDLE))
730730
return;
731731

732+
agent->dedupe_context = NULL;
732733
release_context(context);
733734
}
734735

@@ -1648,6 +1649,7 @@ static void process_query_result(struct data_vio *agent)
16481649

16491650
if (change_context_state(context, DEDUPE_CONTEXT_COMPLETE, DEDUPE_CONTEXT_IDLE)) {
16501651
agent->is_duplicate = decode_uds_advice(context);
1652+
agent->dedupe_context = NULL;
16511653
release_context(context);
16521654
}
16531655
}
@@ -2321,6 +2323,7 @@ static void timeout_index_operations_callback(struct vdo_completion *completion)
23212323
* send its requestor on its way.
23222324
*/
23232325
list_del_init(&context->list_entry);
2326+
context->requestor->dedupe_context = NULL;
23242327
continue_data_vio(context->requestor);
23252328
timed_out++;
23262329
}

0 commit comments

Comments
 (0)