From 492e2de251e2d522efb7f3f573e8bae8f44a8bd6 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Mon, 14 Sep 2020 12:21:10 -0700 Subject: [PATCH] mds/FSMap: check parse_role return before filtering If parse_role fails, then the fscid value is invalid. This was caught in testing cephtool. Funnily enough, the command rmfailed normally fails: 2020-09-06T00:05:51.020 INFO:tasks.workunit.client.0.smithi036.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:35: expect_false: set -x 2020-09-06T00:05:51.020 INFO:tasks.workunit.client.0.smithi036.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:36: expect_false: ceph mds rmfailed 0 2020-09-06T00:05:51.318 INFO:tasks.workunit.client.0.smithi036.stderr:Error EPERM: WARNING: this can make your filesystem inaccessible! Add --yes-i-really-mean-it if you are sure you wish to continue. 2020-09-06T00:05:51.321 INFO:tasks.workunit.client.0.smithi036.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:36: expect_false: return 0 2020-09-06T00:05:51.322 INFO:tasks.workunit.client.0.smithi036.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:989: test_mon_mds: ceph mds rmfailed 0 --yes-i-really-mean-it 2020-09-06T00:05:51.631 INFO:tasks.workunit.client.0.smithi036.stderr:Error EINVAL: Rank '0' not foundinvalid role '0' 2020-09-06T00:05:51.634 INFO:tasks.workunit.client.0.smithi036.stderr:/home/ubuntu/cephtest/clone.client.0/qa/workunits/cephtool/test.sh:990: test_mon_mds: set -e From: /ceph/teuthology-archive/teuthology-2020-09-14_07:01:01-rados-master-distro-basic-smithi/5434134/teuthology.log The change in 811e48d6ffd841ecd93a57eb00c6aceae476f4f8 causes an abort because this failure is not caught in the parse_role hook. Fixes: https://tracker.ceph.com/issues/47444 Fixes: 811e48d6ffd841ecd93a57eb00c6aceae476f4f8 Signed-off-by: Patrick Donnelly --- src/mds/FSMap.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mds/FSMap.cc b/src/mds/FSMap.cc index 797325d6e874e..833aa766861b0 100644 --- a/src/mds/FSMap.cc +++ b/src/mds/FSMap.cc @@ -1022,6 +1022,7 @@ int FSMap::parse_role( const std::vector &filter) const { int r = parse_role(role_str, role, ss); + if (r < 0) return r; string_view fs_name = get_filesystem(role->fscid)->mds_map.get_fs_name(); -- 2.39.5