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: 4a4830cf91 ("cmd: add clone command")
Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
This commit is contained in:
Naveen Kumar Chaudhary
2026-07-10 15:50:48 -06:00
committed by Tom Rini
parent b1d083e444
commit dc3606a961
+1 -1
View File
@@ -97,7 +97,7 @@ read:
write: write:
ret = blk_dwrite(destdesc, destblk, towrite, buf + offset); ret = blk_dwrite(destdesc, destblk, towrite, buf + offset);
if (ret < 0) { if (ret < 0) {
printf("Dest write error @blk %ld\n", srcblk); printf("Dest write error @blk %ld\n", destblk);
goto exit; goto exit;
} }
wrcnt += ret * destbz; wrcnt += ret * destbz;