]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: fix refuse to release lock when cookie is the same at rewatch 20868/head
authorSong Shun <song.shun3@zte.com.cn>
Tue, 20 Mar 2018 03:07:28 +0000 (11:07 +0800)
committerSong Shun <song.shun3@zte.com.cn>
Mon, 26 Mar 2018 12:46:54 +0000 (20:46 +0800)
commit51ac19387c58dd81f66dce77fef4e0e36ce524ea
treefdb864ca96fb69a989896306018487991dc81d9f
parenta7351ce449bbaf2beb8b640a34b72618d504a457
librbd: fix refuse to release lock when cookie is the same at rewatch

  fix exclusive auto-mode lock refuse to release.
  when rewatch, owner_id is reset.
  at the same time, there is a chance to produce the same cookie, which should be different.
  code now skips reacquire lock when the cookie is the same, resulting in unsetting owner_id.
  when other clients request lock, client whose owner_id is null is considered invalid and
  refuse to release lock.
  but unluckily, watcher is always alive, so the client requested lock can't get lock.

Signed-off-by: Song Shun <song.shun3@zte.com.cn>
src/librbd/ManagedLock.cc
src/librbd/ManagedLock.h
src/test/librbd/test_mock_ManagedLock.cc