mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-07 08:50:05 +01:00
Avoid partial read in luks1 reencryption loop.
Starting with kernel 5.17-rc there are some changes in block layer aiming to block partial I/O in O_DIRECT mode.
This commit is contained in:
@@ -737,6 +737,8 @@ static int copy_data_forward(struct reenc_ctx *rc, int fd_old, int fd_new,
|
||||
return -EIO;
|
||||
|
||||
while (!quit && rc->device_offset < rc->device_size) {
|
||||
if ((rc->device_size - rc->device_offset) < (uint64_t)block_size)
|
||||
block_size = rc->device_size - rc->device_offset;
|
||||
s1 = read_buf(fd_old, buf, block_size);
|
||||
if (s1 < 0 || ((size_t)s1 != block_size &&
|
||||
(rc->device_offset + s1) != rc->device_size)) {
|
||||
|
||||
Reference in New Issue
Block a user