From: Rishabh Dave Date: Fri, 7 Apr 2023 18:21:26 +0000 (+0530) Subject: mon/AuthMonitor: log when parsing caps fails X-Git-Tag: v19.0.0~1135^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3fcbb0bcf2bca58d6ca460ec036dc1a986c9875b;p=ceph.git mon/AuthMonitor: log when parsing caps fails AuthMonitor::valid_caps() checks whether or not caps are valid by checking if parsing caps is successful. The respective parsing methods print a error message to stderr when parsing fails but none print a log message. Let's add a log entry when parsing fails are caps are known to be invalid. Signed-off-by: Rishabh Dave --- diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 840ca38fcc4d..4daffddebf96 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -1334,6 +1334,7 @@ bool AuthMonitor::valid_caps( if (type == "mon") { MonCap moncap; if (!moncap.parse(caps, out)) { + dout(20) << "Parsing MON caps failed. MON cap: " << caps << dendl; return false; } return true; @@ -1346,16 +1347,19 @@ bool AuthMonitor::valid_caps( if (type == "mgr") { MgrCap mgrcap; if (!mgrcap.parse(caps, out)) { + dout(20) << "Parsing MGR caps failed. MGR cap: " << caps << dendl; return false; } } else if (type == "osd") { OSDCap ocap; if (!ocap.parse(caps, out)) { + dout(20) << "Parsing OSD caps failed. OSD cap: " << caps << dendl; return false; } } else if (type == "mds") { MDSAuthCaps mdscap; if (!mdscap.parse(g_ceph_context, caps, out)) { + dout(20) << "Parsing MDS caps failed. MDS cap: " << caps << dendl; return false; } } else {