From: Jason Dillaman Date: Mon, 23 Jul 2018 15:40:20 +0000 (-0400) Subject: librbd: reduce log level of write denied permission error X-Git-Tag: v14.0.1~767^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6fe2df96916659c7fa11be09de78e0421a2ff9df;p=ceph.git librbd: reduce log level of write denied permission error The watch OSD op requires write permission since -EPERM will still be returned to the user. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/image/OpenRequest.cc b/src/librbd/image/OpenRequest.cc index 49e755e04f01..ae187395eaae 100644 --- a/src/librbd/image/OpenRequest.cc +++ b/src/librbd/image/OpenRequest.cc @@ -489,7 +489,11 @@ Context *OpenRequest::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); diff --git a/src/librbd/image/OpenRequest.h b/src/librbd/image/OpenRequest.h index aa8bb79d0a97..3b65f5455be5 100644 --- a/src/librbd/image/OpenRequest.h +++ b/src/librbd/image/OpenRequest.h @@ -42,7 +42,7 @@ private: * v | * V2_GET_ID|NAME | * | | - * v | + * v (skip if have name) | * V2_GET_NAME_FROM_TRASH | * | | * v |