From d93b488e322397fd47a7746cc2340912652bd054 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 20 Jun 2026 11:24:29 +0300 Subject: [PATCH] Just in case - OP_SYNC cannot fail but handle its error in vitastor-cli dd --- src/cmd/cli_dd.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cmd/cli_dd.cpp b/src/cmd/cli_dd.cpp index 8c5d3a9a..e31b01b3 100644 --- a/src/cmd/cli_dd.cpp +++ b/src/cmd/cli_dd.cpp @@ -324,8 +324,14 @@ resume_2: cluster_op_t *sync_op = new cluster_op_t; sync_op->opcode = OSD_OP_SYNC; parent->waiting++; - sync_op->callback = [parent](cluster_op_t *sync_op) + sync_op->callback = [this, parent](cluster_op_t *sync_op) { + if (sync_op->retval != 0 && !result.err) + { + // Just in case, actually OP_SYNC can't fail + result.err = -sync_op->retval; + result.text = "Failed to sync "+oimg+": "+std::string(strerror(result.err)); + } parent->waiting--; delete sync_op; parent->ringloop->wakeup();