]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: reduce log level of write denied permission error
authorJason Dillaman <dillaman@redhat.com>
Mon, 23 Jul 2018 15:40:20 +0000 (11:40 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 24 Jul 2018 12:52:33 +0000 (08:52 -0400)
The watch OSD op requires write permission since -EPERM will still
be returned to the user.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/image/OpenRequest.cc
src/librbd/image/OpenRequest.h

index 49e755e04f0136d72413a333a2cdc984b3305d59..ae187395eaaef078d3a5066a404517109d0234be 100644 (file)
@@ -489,7 +489,11 @@ Context *OpenRequest<I>::handle_register_watch(int *result) {
   CephContext *cct = m_image_ctx->cct;
   ldout(cct, 10) << this << " " << __func__ << ": r=" << *result << dendl;
 
-  if (*result < 0) {
+  if (*result == -EPERM) {
+    ldout(cct, 5) << "user does not have write permission" << dendl;
+    send_close_image(*result);
+    return nullptr;
+  } else if (*result < 0) {
     lderr(cct) << "failed to register watch: " << cpp_strerror(*result)
                << dendl;
     send_close_image(*result);
index aa8bb79d0a97848ff6c770d45fa98062d2fa60ab..3b65f5455be54227aca80413833748468525c957 100644 (file)
@@ -42,7 +42,7 @@ private:
    *                v                               |
    *            V2_GET_ID|NAME                      |
    *                |                               |
-   *                v                               |
+   *                v (skip if have name)           |
    *            V2_GET_NAME_FROM_TRASH              |
    *                |                               |
    *                v                               |