]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/ExclusiveLock.cc
update sources to 12.2.10
[ceph.git] / ceph / src / librbd / ExclusiveLock.cc
index 5821548f17b5c852016f2a5390aa1ed063097555..a70e77e917c053594b6038c6017a342282ece78c 100644 (file)
@@ -90,6 +90,14 @@ void ExclusiveLock<I>::unblock_requests() {
   ldout(m_image_ctx.cct, 20) << dendl;
 }
 
+template <typename I>
+int ExclusiveLock<I>::get_unlocked_op_error() const {
+  if (m_image_ctx.image_watcher->is_blacklisted()) {
+    return -EBLACKLISTED;
+  }
+  return -EROFS;
+}
+
 template <typename I>
 void ExclusiveLock<I>::init(uint64_t features, Context *on_init) {
   assert(m_image_ctx.owner_lock.is_locked());
@@ -129,11 +137,12 @@ void ExclusiveLock<I>::handle_peer_notification(int r) {
 }
 
 template <typename I>
-Context *ExclusiveLock<I>::start_op() {
+Context *ExclusiveLock<I>::start_op(int* ret_val) {
   assert(m_image_ctx.owner_lock.is_locked());
   Mutex::Locker locker(ML<I>::m_lock);
 
   if (!accept_ops(ML<I>::m_lock)) {
+    *ret_val = get_unlocked_op_error();
     return nullptr;
   }