CephContext *cct = m_image_ctx.cct;
ldout(cct, 20) << "flatten" << dendl;
- if (m_image_ctx.read_only) {
+ if (m_image_ctx.read_only || m_image_ctx.operations_disabled) {
on_finish->complete(-EROFS);
return;
}
CephContext *cct = m_image_ctx.cct;
ldout(cct, 5) << this << " " << __func__ << dendl;
- if (m_image_ctx.read_only) {
+ if (m_image_ctx.read_only || m_image_ctx.operations_disabled) {
on_finish->complete(-EROFS);
return;
}
+
if (!m_image_ctx.test_features(RBD_FEATURE_OBJECT_MAP)) {
lderr(cct) << "image must support object-map feature" << dendl;
on_finish->complete(-EINVAL);
m_image_ctx.exclusive_lock->is_lock_owner());
}
+ if (m_image_ctx.operations_disabled) {
+ on_finish->complete(-EROFS);
+ return;
+ }
+
m_image_ctx.snap_lock.get_read();
if (m_image_ctx.name == dest_name) {
m_image_ctx.snap_lock.put_read();
<< "size=" << m_image_ctx.size << ", "
<< "new_size=" << size << dendl;
- if (m_image_ctx.snap_id != CEPH_NOSNAP || m_image_ctx.read_only) {
+ if (m_image_ctx.snap_id != CEPH_NOSNAP || m_image_ctx.read_only ||
+ m_image_ctx.operations_disabled) {
m_image_ctx.snap_lock.put_read();
on_finish->complete(-EROFS);
return;
ldout(cct, 5) << this << " " << __func__ << ": snap_name=" << snap_name
<< dendl;
+ if (m_image_ctx.operations_disabled) {
+ on_finish->complete(-EROFS);
+ return;
+ }
+
m_image_ctx.snap_lock.get_read();
if (m_image_ctx.get_snap_id(snap_namespace, snap_name) != CEPH_NOSNAP) {
m_image_ctx.snap_lock.put_read();
ldout(cct, 5) << this << " " << __func__ << ": snap_name=" << snap_name
<< dendl;
+ if (m_image_ctx.operations_disabled) {
+ on_finish->complete(-EROFS);
+ return;
+ }
+
m_image_ctx.snap_lock.get_read();
uint64_t snap_id = m_image_ctx.get_snap_id(snap_namespace, snap_name);
if (snap_id == CEPH_NOSNAP) {
ldout(cct, 5) << this << " " << __func__ << ": snap_name=" << snap_name
<< dendl;
+ if (m_image_ctx.operations_disabled) {
+ on_finish->complete(-EROFS);
+ return;
+ }
+
m_image_ctx.snap_lock.get_read();
uint64_t snap_id = m_image_ctx.get_snap_id(snap_namespace, snap_name);
if (snap_id == CEPH_NOSNAP) {
m_image_ctx.exclusive_lock->is_lock_owner());
}
+ if (m_image_ctx.operations_disabled) {
+ on_finish->complete(-EROFS);
+ return;
+ }
+
m_image_ctx.snap_lock.get_read();
if (m_image_ctx.get_snap_id(cls::rbd::UserSnapshotNamespace(),
dest_snap_name) != CEPH_NOSNAP) {
m_image_ctx.exclusive_lock->is_lock_owner());
}
+ if (m_image_ctx.operations_disabled) {
+ on_finish->complete(-EROFS);
+ return;
+ }
+
m_image_ctx.snap_lock.get_read();
bool is_protected;
int r = m_image_ctx.is_snap_protected(m_image_ctx.get_snap_id(snap_namespace, snap_name),
m_image_ctx.exclusive_lock->is_lock_owner());
}
+ if (m_image_ctx.operations_disabled) {
+ on_finish->complete(-EROFS);
+ return;
+ }
+
m_image_ctx.snap_lock.get_read();
bool is_unprotected;
int r = m_image_ctx.is_snap_unprotected(m_image_ctx.get_snap_id(snap_namespace, snap_name),
ldout(cct, 5) << this << " " << __func__ << ": features=" << features
<< ", enabled=" << enabled << dendl;
+ if (m_image_ctx.operations_disabled) {
+ on_finish->complete(-EROFS);
+ return;
+ }
+
if (enabled) {
operation::EnableFeaturesRequest<I> *req =
new operation::EnableFeaturesRequest<I>(
ldout(cct, 5) << this << " " << __func__ << ": key=" << key << ", value="
<< value << dendl;
+ if (m_image_ctx.operations_disabled) {
+ on_finish->complete(-EROFS);
+ return;
+ }
+
operation::MetadataSetRequest<I> *request =
new operation::MetadataSetRequest<I>(m_image_ctx,
new C_NotifyUpdate<I>(m_image_ctx, on_finish),
CephContext *cct = m_image_ctx.cct;
ldout(cct, 5) << this << " " << __func__ << ": key=" << key << dendl;
+ if (m_image_ctx.operations_disabled) {
+ on_finish->complete(-EROFS);
+ return;
+ }
+
operation::MetadataRemoveRequest<I> *request =
new operation::MetadataRemoveRequest<I>(
m_image_ctx,