]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/FSMap: check parse_role return before filtering 37147/head
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 14 Sep 2020 19:21:10 +0000 (12:21 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 14 Sep 2020 19:21:10 +0000 (12:21 -0700)
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 <pdonnell@redhat.com>
src/mds/FSMap.cc

index 797325d6e874ed3f00e0a944d98315b91dcfd352..833aa766861b06c75912d5a5ef619b977578043d 100644 (file)
@@ -1022,6 +1022,7 @@ int FSMap::parse_role(
     const std::vector<string> &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();