mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2026-01-09 08:55:31 +01:00
Hide return code check fot fallocate (that can silenty fail in this context).
This commit is contained in:
@@ -440,7 +440,8 @@ static int move_keyslot_areas(struct crypt_device *cd, off_t offset_from,
|
||||
}
|
||||
|
||||
/* This can safely fail (for block devices). It only allocates space if it is possible. */
|
||||
posix_fallocate(devfd, offset_to, buf_size);
|
||||
if (posix_fallocate(devfd, offset_to, buf_size))
|
||||
log_dbg("Preallocation (fallocate) of new keyslot area not available.");
|
||||
|
||||
/* Try to read *new* area to check that area is there (trimmed backup). */
|
||||
if (read_lseek_blockwise(devfd, device_block_size(device),
|
||||
|
||||
@@ -900,7 +900,7 @@ static int restore_luks_header(struct reenc_ctx *rc)
|
||||
stat(rc->header_file_new, &st) != -1) {
|
||||
fd = open(rc->device_header, O_WRONLY);
|
||||
if (fd != -1) {
|
||||
posix_fallocate(fd, 0, st.st_size);
|
||||
if (posix_fallocate(fd, 0, st.st_size)) {};
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user