]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd: fix rare race while looking for a pg
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 3 Aug 2016 08:18:16 +0000 (16:18 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 3 Aug 2016 23:05:44 +0000 (07:05 +0800)
commit8af1031790b7b90809a4af7dccdfefd9a03d4ed6
tree3ee40c341494b15ba7a4664c32ee41172a86a924
parent5eccd8dcc5437119b03ee8c31518de5cfb3641a7
osd: fix rare race while looking for a pg

When _have_pg() returns true, we drop the pg_map_lock
and pg->lock() simultaneously. So theoretically the
subsequent call to _lookup_lock_pg() can return NULL,
although the chance is rare.

Also, since we are going to call _lookup_lock_pg() anyway,
we can call it directly, thus the _have_pg() method is
totally unnecessary.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/OSD.cc
src/osd/OSD.h