Bug #56549
closedImageWatcher race condition
0%
Description
ImageWatcher hits race condition when snap_remove process happens during a notify request lock for exclusive lock.
1. RBD mirror detects newer snapshot and queues the removal of old snapshot for operation #1 (exclusive lock).
2. The current lock owner doesn't support snap removal.
3. Another operation #2 is queued (exclusive lock) request is made for same image. This portion of the code checks for is_lock_owner and isn't so it continues code path to request exclusive lock.
4. Operation #1 is processed. It gets exclusive lock and performs snap removal.
5. Operation #2 is processed. The handle portion of the callback still expects to be non lock owner via another is_lock_owner check. But due to timing of #4 it currently is lock owner and ceph_assert/crash happens.