]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: flatten should return -EROFS if image is read-only 4585/head
authorJason Dillaman <dillaman@redhat.com>
Mon, 27 Apr 2015 05:03:52 +0000 (01:03 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 6 May 2015 15:52:13 +0000 (11:52 -0400)
Fixes: #11475
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit f141e02ab719df830648318f4c1d9ca286071ed3)

src/librbd/internal.cc

index ba494f96fbcb7942364fe185627e1685669b96fb..ba6722dc613f66c5a20fe1c46e5813984710767b 100644 (file)
@@ -2518,6 +2518,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) {