summaryrefslogtreecommitdiff
blob: 6800285318f0932e805d9278d521791a42a8139e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 787ba33e5dba285dff874955a8f0d7aabd3f87fe Mon Sep 17 00:00:00 2001
From: Jason Dillaman <dillaman@redhat.com>
Date: Mon, 5 Jun 2017 08:17:05 -0400
Subject: [PATCH] librbd: filter expected error codes from
 is_exclusive_lock_owner

Fixes: http://tracker.ceph.com/issues/20182
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit d4daaf54e6bc42cd4fb2111ea20b2042941b0c31)
---
 src/librbd/internal.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc
index 9fecb1e1688f..6021be078090 100644
--- a/src/librbd/internal.cc
+++ b/src/librbd/internal.cc
@@ -2110,7 +2110,9 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force,
     // might have been blacklisted by peer -- ensure we still own
     // the lock by pinging the OSD
     int r = ictx->exclusive_lock->assert_header_locked();
-    if (r < 0) {
+    if (r == -EBUSY || r == -ENOENT) {
+      return 0;
+    } else if (r < 0) {
       return r;
     }