The check preventing snapshot removal on read-only images was previously
commented out. This commit restores the original behavior to ensure that
snap_remove() correctly rejects operations on images that are not writable
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
ldout(cct, 5) << this << " " << __func__ << ": snap_name=" << snap_name
<< dendl;
- //if (m_image_ctx.read_only) {
- // on_finish->complete(-EROFS);
- // return;
- //}
+ if (m_image_ctx.read_only) {
+ on_finish->complete(-EROFS);
+ return;
+ }
// quickly filter out duplicate ops
m_image_ctx.image_lock.lock_shared();