From 970a17368a2ce0d94e9ef6a6e4022ca5d86f63ad Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Fri, 25 Mar 2016 11:01:01 -0400 Subject: [PATCH] librbd: blacklist journal error while attempting to acquire lock The journal policy will return -EPERM if attempting to acquire the exclusive lock when the image is non-primary. Signed-off-by: Jason Dillaman --- src/librbd/ExclusiveLock.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librbd/ExclusiveLock.cc b/src/librbd/ExclusiveLock.cc index bd945e6a233..82d00425e0b 100644 --- a/src/librbd/ExclusiveLock.cc +++ b/src/librbd/ExclusiveLock.cc @@ -373,7 +373,8 @@ void ExclusiveLock::handle_acquire_lock(int r) { Action action = get_active_action(); assert(action == ACTION_TRY_LOCK || action == ACTION_REQUEST_LOCK); - if (action == ACTION_REQUEST_LOCK && r < 0 && r != -EBLACKLISTED) { + if (action == ACTION_REQUEST_LOCK && r < 0 && r != -EBLACKLISTED && + r != -EPERM) { m_state = STATE_WAITING_FOR_PEER; m_lock.Unlock();