]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd: fix watch_lock vs map_lock ordering
authorSage Weil <sage.weil@dreamhost.com>
Fri, 9 Mar 2012 21:34:55 +0000 (13:34 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 9 Mar 2012 21:34:55 +0000 (13:34 -0800)
commite43546dee9246773ffd6877b4f9495f1ec61cd55
treea8feaafd874550bcd91ff50bca40dcbdb6e505d1
parent80d92528099cf2a7230d7768197ce1ef89256d8b
osd: fix watch_lock vs map_lock ordering

watch_lock is inside map_lock (and pg->lock), which means we need to
drop it to take pg->lock here.  That means verifying in
handle_watch_timeout that we haven't raced with another thread canceling
the timeout event, which would be indicated by

 - the entity not appearing in unconnected_watchers
 - the entity having a different (presumably newer) expire time

Fixes: #2103
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Reviewed-by: Samuel Just <samuel.just@dreamhost.com>
src/osd/OSD.cc
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h
src/osd/Watch.h