From: Jason Dillaman Date: Mon, 27 Apr 2015 05:03:52 +0000 (-0400) Subject: librbd: flatten should return -EROFS if image is read-only X-Git-Tag: v9.0.1~68^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4470%2Fhead;p=ceph.git librbd: flatten should return -EROFS if image is read-only Fixes: #11475 Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 7aea482341aa..42e01245db7f 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -2630,6 +2630,10 @@ reprotect_and_return_err: return r; } + if (ictx->read_only) { + return -EROFS; + } + { RWLock::RLocker parent_locker(ictx->parent_lock); if (ictx->parent_md.spec.pool_id == -1) {