Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osd: fix rare race for pg relevant events
Theoretically even if _have_pg() returns ture, we still can't assert that _lookup_lock_pg() will always succeed. This is because when we switch between these two methods, we will drop pg_map_lock, and thus may let a pg removal sneak in, which may eventually cause divergence. However this is a really rare case, and is less likely to happen in a production environment. But this pr provided a safer way to achieve the same goal and is a little faster by eliminating a duplicated search from the pg_map, which makes it meaningful. Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
- Loading branch information
1 parent
4546427
commit 7bcaedb
Showing
1 changed file
with
37 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters