While verifying, when reading the block device, read only as much as was read from the file.

This commit is contained in:
Imbus 2026-02-04 23:57:07 +01:00
parent e69243180f
commit 1e82124264

View file

@ -94,9 +94,9 @@ int perform_write(write_job_t *job) {
while (1) {
ssize_t read_file = read(file_fd, job->buffer2, job->block_size);
ssize_t read_block = read(block_fd, job->buffer, job->block_size);
ssize_t read_block = read(block_fd, job->buffer, read_file);
assert(read_block >= read_file);
assert(read_block == read_file);
assert(read_block >= 0);
assert(read_file >= 0);