From a577f6fa405c469f424ee488dbb489d70d21f4de Mon Sep 17 00:00:00 2001 From: Miki Patel Date: Wed, 23 Jul 2025 17:11:10 +0530 Subject: [PATCH] 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 --- src/krbd.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; -- 2.39.5