]> git-server-git.apps.pok.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>
Thu, 16 Aug 2018 12:07:32 +0000 (08:07 -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>
(cherry picked from commit 6fe2df96916659c7fa11be09de78e0421a2ff9df)

src/librbd/image/OpenRequest.cc
src/librbd/image/OpenRequest.h

index 547e59d81c337ade0b788b41fdff1611f2f2f9c5..22f376bc4a0375ca828f34aa27e7d89cf79516ae 100644 (file)
@@ -488,7 +488,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                               |