From: Burt Holzman Date: Wed, 2 Feb 2022 15:18:52 +0000 (-0600) Subject: krbd: return error when no initial monitor address found X-Git-Tag: v16.2.8~144^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4baec8bdd2c264ca30313248fd3788b63593446b;p=ceph.git krbd: return error when no initial monitor address found Since we filter monitor addresses based on ms_mode, check that at least one address was found. Otherwise, we mismatch arguments when calling sysfs/add_single_major which emits a misleading error message to dmesg: libceph: resolve 'name=user1' (ret=-3): failed libceph: parse_ips bad ip 'name=user1,key=client.user1' Fixes: https://tracker.ceph.com/issues/54128 Signed-off-by: Burt Holzman (cherry picked from commit 0076ffc86e043af7aedc127df8661eaf87fc1c58) --- diff --git a/src/krbd.cc b/src/krbd.cc index fdcbc3abb6814..c2eb48070a66b 100644 --- a/src/krbd.cc +++ b/src/krbd.cc @@ -221,6 +221,11 @@ static int build_map_buf(CephContext *cct, const krbd_spec& spec, } } + if (oss.tellp() == 0) { + std::cerr << "rbd: failed to get mon address (possible ms_mode mismatch)" << std::endl; + return -ENOENT; + } + oss << " name=" << cct->_conf->name.get_id(); KeyRing keyring;