From: Sage Weil Date: Fri, 15 Nov 2019 18:31:46 +0000 (-0600) Subject: mds/SessionMap: interpret bare id as a valid filter X-Git-Tag: v15.1.0~519^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b6634d4668721069eb78038218840f764a04fe06;p=ceph-ci.git mds/SessionMap: interpret bare id as a valid filter This works around the fact that the old asok 'session evict' took a bare id and the tell version took a filter. Signed-off-by: Sage Weil --- diff --git a/src/mds/SessionMap.cc b/src/mds/SessionMap.cc index 854d575a8ea..d4b32d82235 100644 --- a/src/mds/SessionMap.cc +++ b/src/mds/SessionMap.cc @@ -1103,8 +1103,15 @@ int SessionFilter::parse( auto eq = s.find("="); if (eq == std::string::npos || eq == s.size()) { - *ss << "Invalid filter '" << s << "'"; - return -EINVAL; + // allow this to be a bare id for compatibility with pre-octopus asok + // 'session evict'. + std::string err; + id = strict_strtoll(s.c_str(), 10, &err); + if (!err.empty()) { + *ss << "Invalid filter '" << s << "'"; + return -EINVAL; + } + return 0; } // Keys that start with this are to be taken as referring