From: Miki Patel Date: Wed, 23 Jul 2025 11:41:10 +0000 (+0530) Subject: krbd: "rbd device map" command should use msgr2 by default X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a577f6fa405c469f424ee488dbb489d70d21f4de;p=ceph.git krbd: "rbd device map" command should use msgr2 by default Making msgr2 and ms_mode=prefer-crc as default option for "rbd device map" command Fixes: https://tracker.ceph.com/issues/72134 Signed-off-by: Miki Patel --- diff --git a/src/krbd.cc b/src/krbd.cc index 5f6e32b6cff30..f232fdf8c3ee3 100644 --- a/src/krbd.cc +++ b/src/krbd.cc @@ -192,7 +192,8 @@ static int have_minor_attr(void) static int build_map_buf(CephContext *cct, const krbd_spec& spec, const string& options, string *pbuf) { - bool msgr2 = false; + bool msgr2 = true; + bool ms_mode_specified = false; std::ostringstream oss; int r; @@ -202,6 +203,7 @@ static int build_map_buf(CephContext *cct, const krbd_spec& spec, if (boost::starts_with(t, "ms_mode=")) { /* msgr2 unless ms_mode=legacy */ msgr2 = t.compare(8, t.npos, "legacy"); + ms_mode_specified = true; } } @@ -272,6 +274,12 @@ static int build_map_buf(CephContext *cct, const krbd_spec& spec, if (!options.empty()) oss << "," << options; + + /* setting default messenger: msgr2 in prefer-crc mode */ + if (!ms_mode_specified) { + oss << ",ms_mode=prefer-crc"; + } + if (!spec.nspace_name.empty()) oss << ",_pool_ns=" << spec.nspace_name;