summaryrefslogtreecommitdiffstats
path: root/src/partition
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-11-10 22:45:02 +0100
committerLennart Poettering <lennart@poettering.net>2023-11-10 22:53:49 +0100
commita053f801f85190fb7dd608f7aa57df55cb6d9161 (patch)
treef65a892e42c2dab83785a5322a2f9da99898ea17 /src/partition
parentrepart: mention how long it took to copy in data blocks (diff)
downloadsystemd-a053f801f85190fb7dd608f7aa57df55cb6d9161.tar.xz
systemd-a053f801f85190fb7dd608f7aa57df55cb6d9161.zip
repart: when we copy in blocks, indicate we are doing from an offset
At first I thought when using --copy-from= that it was copying in my whole disk into a partition instead of just a partition into a partition. Let's make the log message clearer and say that we copy starting from an offset.
Diffstat (limited to 'src/partition')
-rw-r--r--src/partition/repart.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c
index fc0ed48a54..d01fec63f5 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -4291,11 +4291,16 @@ static int context_copy_blocks(Context *context) {
return r;
}
- log_info("Copying in '%s' (%s) on block level into future partition %" PRIu64 ".",
- p->copy_blocks_path, FORMAT_BYTES(p->copy_blocks_size), p->partno);
+ if (p->copy_blocks_offset == UINT64_MAX)
+ log_info("Copying in '%s' (%s) on block level into future partition %" PRIu64 ".",
+ p->copy_blocks_path, FORMAT_BYTES(p->copy_blocks_size), p->partno);
+ else {
+ log_info("Copying in '%s' @ %" PRIu64 " (%s) on block level into future partition %" PRIu64 ".",
+ p->copy_blocks_path, p->copy_blocks_offset, FORMAT_BYTES(p->copy_blocks_size), p->partno);
- if (p->copy_blocks_offset != UINT64_MAX && lseek(p->copy_blocks_fd, p->copy_blocks_offset, SEEK_SET) < 0)
- return log_error_errno(errno, "Failed to seek to copy blocks offset in %s: %m", p->copy_blocks_path);
+ if (lseek(p->copy_blocks_fd, p->copy_blocks_offset, SEEK_SET) < 0)
+ return log_error_errno(errno, "Failed to seek to copy blocks offset in %s: %m", p->copy_blocks_path);
+ }
r = copy_bytes(p->copy_blocks_fd, partition_target_fd(t), p->copy_blocks_size, COPY_REFLINK);
if (r < 0)