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:
committed by
Tom Rini
parent
b1d083e444
commit
dc3606a961
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user