From 0b70c536234d60a98199fbe5bcdb5da55713fa26 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 15 Oct 2013 15:01:53 -0700 Subject: cls_rbd: do not make noise in osd log on rbd removal ubuntu@burnupi06:~$ tail -f /var/log/ceph/ceph-osd.1.log 2013-02-07 17:00:30.565749 7fdb09e6b700 0 cls/rbd/cls_rbd.cc:1615: error reading id for name 'sds': -2 2013-02-07 17:00:30.566301 7fdb0a66c700 0 cls/rbd/cls_rbd.cc:1521: error reading name to id mapping: -2 2013-02-07 17:03:54.085700 7fdb0a66c700 0 cls/rbd/cls_rbd.cc:1615: error reading id for name 'sdfsd': -2 2013-02-07 17:03:54.086143 7fdb09e6b700 0 cls/rbd/cls_rbd.cc:1521: error reading name to id mapping: -2 Fixes: #4047 Signed-off-by: Sage Weil --- src/cls/rbd/cls_rbd.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cls/rbd/cls_rbd.cc b/src/cls/rbd/cls_rbd.cc index 12947a08540..adfe4626caa 100644 --- a/src/cls/rbd/cls_rbd.cc +++ b/src/cls/rbd/cls_rbd.cc @@ -1524,7 +1524,7 @@ static int dir_remove_image_helper(cls_method_context_t hctx, string name_key = dir_key_for_name(name); string id_key = dir_key_for_id(id); int r = read_key(hctx, name_key, &stored_id); - if (r < 0) { + if (r < 0 && r != -ENOENT) { CLS_ERR("error reading name to id mapping: %d", r); return r; } @@ -1618,7 +1618,7 @@ int dir_get_id(cls_method_context_t hctx, bufferlist *in, bufferlist *out) string id; int r = read_key(hctx, dir_key_for_name(name), &id); - if (r < 0) { + if (r < 0 && r != -ENOENT) { CLS_ERR("error reading id for name '%s': %d", name.c_str(), r); return r; } -- cgit v1.2.1