From: Ilya Dryomov Date: Sun, 14 Jul 2024 17:48:33 +0000 (+0200) Subject: librbd/migration: massage some error messages X-Git-Tag: v18.2.5~459^2~11 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=97a856bf0caa7f851a10ffbe181468f16bef6cc8;p=ceph.git librbd/migration: massage some error messages Add missing spaces, don't use the word stream when reporting errors on POSIX file operations (open() and lseek64()) and fix a cut-and-paste typo in RawSnapshot. Signed-off-by: Ilya Dryomov (cherry picked from commit 789df2ce38f35ffb3e86974e02868e5fff71e72c) --- diff --git a/src/librbd/migration/FileStream.cc b/src/librbd/migration/FileStream.cc index 63cd722dd3c52..b548de7ee37ea 100644 --- a/src/librbd/migration/FileStream.cc +++ b/src/librbd/migration/FileStream.cc @@ -74,7 +74,7 @@ struct FileStream::ReadRequest { auto offset = lseek64(file_stream->m_file_no, byte_extent.first, SEEK_SET); if (offset == -1) { r = -errno; - lderr(cct) << "failed to seek file stream: " << cpp_strerror(r) << dendl; + lderr(cct) << "failed to seek file: " << cpp_strerror(r) << dendl; finish(r); return; } @@ -149,7 +149,7 @@ void FileStream::open(Context* on_finish) { m_file_no = ::open(file_path.c_str(), O_RDONLY); if (m_file_no < 0) { int r = -errno; - lderr(m_cct) << "failed to open file stream '" << file_path << "': " + lderr(m_cct) << "failed to open file '" << file_path << "': " << cpp_strerror(r) << dendl; on_finish->complete(r); return; diff --git a/src/librbd/migration/HttpClient.cc b/src/librbd/migration/HttpClient.cc index 90d5723ed84cb..28e21626f6028 100644 --- a/src/librbd/migration/HttpClient.cc +++ b/src/librbd/migration/HttpClient.cc @@ -283,7 +283,7 @@ private: ldout(cct, 15) << "r=" << r << dendl; if (r < 0) { - lderr(cct) << "failed to disconnect stream: '" << cpp_strerror(r) + lderr(cct) << "failed to disconnect stream: " << cpp_strerror(r) << dendl; } @@ -350,7 +350,7 @@ private: ldout(cct, 15) << "r=" << r << dendl; if (r < 0) { - lderr(cct) << "failed to disconnect stream: '" << cpp_strerror(r) + lderr(cct) << "failed to disconnect stream: " << cpp_strerror(r) << dendl; } diff --git a/src/librbd/migration/OpenSourceImageRequest.cc b/src/librbd/migration/OpenSourceImageRequest.cc index 8abdedf332d99..da2aa73eceaeb 100644 --- a/src/librbd/migration/OpenSourceImageRequest.cc +++ b/src/librbd/migration/OpenSourceImageRequest.cc @@ -72,8 +72,8 @@ void OpenSourceImageRequest::open_source() { int r = source_spec_builder.parse_source_spec(source_spec, &source_spec_object); if (r < 0) { - lderr(m_cct) << "failed to parse migration source-spec:" << cpp_strerror(r) - << dendl; + lderr(m_cct) << "failed to parse migration source-spec: " + << cpp_strerror(r) << dendl; (*m_src_image_ctx)->state->close(); finish(r); return; diff --git a/src/librbd/migration/QCOWFormat.cc b/src/librbd/migration/QCOWFormat.cc index cedf9aa20f02c..f05c35b9728b2 100644 --- a/src/librbd/migration/QCOWFormat.cc +++ b/src/librbd/migration/QCOWFormat.cc @@ -842,8 +842,8 @@ void QCOWFormat::open(Context* on_finish) { int r = m_source_spec_builder->build_stream(m_json_object, &m_stream); if (r < 0) { - lderr(cct) << "failed to build migration stream handler" << cpp_strerror(r) - << dendl; + lderr(cct) << "failed to build migration stream handler: " + << cpp_strerror(r) << dendl; on_finish->complete(r); return; } diff --git a/src/librbd/migration/RawSnapshot.cc b/src/librbd/migration/RawSnapshot.cc index 4a83fd8ad97ea..f56d518c3e13c 100644 --- a/src/librbd/migration/RawSnapshot.cc +++ b/src/librbd/migration/RawSnapshot.cc @@ -153,8 +153,8 @@ void RawSnapshot::open(SnapshotInterface* previous_snapshot, int r = m_source_spec_builder->build_stream(m_json_object, &m_stream); if (r < 0) { - lderr(cct) << "failed to build migration stream handler" << cpp_strerror(r) - << dendl; + lderr(cct) << "failed to build migration stream handler: " + << cpp_strerror(r) << dendl; on_finish->complete(r); return; } diff --git a/src/librbd/migration/SourceSpecBuilder.cc b/src/librbd/migration/SourceSpecBuilder.cc index 214d7ce0e5d44..b334d8769f760 100644 --- a/src/librbd/migration/SourceSpecBuilder.cc +++ b/src/librbd/migration/SourceSpecBuilder.cc @@ -96,7 +96,7 @@ int SourceSpecBuilder::build_snapshot( snapshot->reset(RawSnapshot::create(m_image_ctx, source_spec_object, this, index)); } else { - lderr(cct) << "unknown or unsupported format type '" << type << "'" + lderr(cct) << "unknown or unsupported snapshot type '" << type << "'" << dendl; return -ENOSYS; }