]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: ignore error when object map is already locked by current client 12484/head
authorrunsisi <runsisi@zte.com.cn>
Wed, 14 Dec 2016 07:18:18 +0000 (15:18 +0800)
committerrunsisi <runsisi@zte.com.cn>
Fri, 16 Dec 2016 00:33:19 +0000 (08:33 +0800)
otherwise when using rbd cli to rollback image with object-map feature
enabled, the following error message will be printed out on the screen,
which is confusing to users:
  librbd::object_map::LockRequest: failed to lock object map: (17) File exists

Fixes: http://tracker.ceph.com/issues/16179
Signed-off-by: runsisi <runsisi@zte.com.cn>
src/librbd/object_map/LockRequest.cc

index 213799aabc5ca5e48bc87a42f4749cd8239c4e73..f5687f7f5dba0290b61005f70d7d9d0afefc96d4 100644 (file)
@@ -54,6 +54,10 @@ Context *LockRequest<I>::handle_lock(int *ret_val) {
 
   if (*ret_val == 0) {
     return m_on_finish;
+  } else if (*ret_val == -EEXIST) {
+    // already locked by myself
+    *ret_val = 0;
+    return m_on_finish;
   } else if (m_broke_lock || *ret_val != -EBUSY) {
     lderr(cct) << "failed to lock object map: " << cpp_strerror(*ret_val)
                << dendl;