Skip to content
Commit a2f998a7 authored by Hou Tao's avatar Hou Tao Committed by Mike Snitzer
Browse files

dm ioctl: remove unnecessary check when using dm_get_mdptr()



__hash_remove() removes hash_cell with _hash_lock locked, so acquiring
_hash_lock can guarantee no-NULL hc returned from dm_get_mdptr() must
have not been removed and hc->md must still be md.

__hash_remove() also acquires dm_hash_cells_mutex before setting mdptr
as NULL. So in dm_copy_name_and_uuid(), after acquiring
dm_hash_cells_mutex and ensuring returned hc is not NULL, the returned
hc must still be alive and hc->md must still be md.

Remove the unnecessary hc->md != md checks when using dm_get_mdptr()
with _hash_lock or dm_hash_cells_mutex acquired.

Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent 69868beb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment