The watch OSD op requires write permission since -EPERM will still
be returned to the user.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
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);
* v |
* V2_GET_ID|NAME |
* | |
- * v |
+ * v (skip if have name) |
* V2_GET_NAME_FROM_TRASH |
* | |
* v |