From a5e5420f94b3181d458b1348ac26b841c0f60a99 Mon Sep 17 00:00:00 2001 From: Yanhu Cao Date: Tue, 8 Aug 2017 18:52:31 +0800 Subject: [PATCH] osd/OSD: add 'isvalid=false' when failed to parse caps Signed-off-by: Yanhu Cao --- src/osd/OSD.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 58245ecb49d..b44b4986f62 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -7057,12 +7057,15 @@ bool OSD::ms_verify_authorizer(Connection *con, int peer_type, ::decode(str, p); } catch (buffer::error& e) { + isvalid = false; } bool success = s->caps.parse(str); if (success) dout(10) << " session " << s << " " << s->entity_name << " has caps " << s->caps << " '" << str << "'" << dendl; - else + else { dout(10) << " session " << s << " " << s->entity_name << " failed to parse caps '" << str << "'" << dendl; + isvalid = false; + } } s->put();