From dc3606a961fae711e51d0ec9e0cff7999b62ab2b Mon Sep 17 00:00:00 2001 From: Naveen Kumar Chaudhary Date: Fri, 26 Jun 2026 09:15:42 +0530 Subject: [PATCH] cmd: clone: report destination block number on dest write error The error path of the destination blk_dwrite() prints srcblk, which refers to the source device's block counter and is unrelated to the write that just failed. This produces misleading diagnostics that point at the wrong block on the wrong device when a clone aborts on a write error. Print destblk so the message identifies the block that actually failed, mirroring the existing "Src read error @blk %ld" message above which correctly uses srcblk. Fixes: 4a4830cf915 ("cmd: add clone command") Signed-off-by: Naveen Kumar Chaudhary --- cmd/clone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/clone.c b/cmd/clone.c index 1f3cff1836d..371f06d917a 100644 --- a/cmd/clone.c +++ b/cmd/clone.c @@ -97,7 +97,7 @@ read: write: ret = blk_dwrite(destdesc, destblk, towrite, buf + offset); if (ret < 0) { - printf("Dest write error @blk %ld\n", srcblk); + printf("Dest write error @blk %ld\n", destblk); goto exit; } wrcnt += ret * destbz;