From: Prasanna Kumar Kalever Date: Fri, 5 Dec 2025 11:46:33 +0000 (+0530) Subject: librbd: restore readonly image check in snap_remove() X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fheads%2Fwip-rbd-cgsm-base;p=ceph-ci.git librbd: restore readonly image check in snap_remove() 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 --- diff --git a/src/librbd/Operations.cc b/src/librbd/Operations.cc index 7fb76fd8a60..f233c642287 100644 --- a/src/librbd/Operations.cc +++ b/src/librbd/Operations.cc @@ -1033,10 +1033,10 @@ void Operations::snap_remove(const cls::rbd::SnapshotNamespace& snap_namespac 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();