mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 03:40:05 +01:00
Sync device using internal write enabled descriptor.
This commit is contained in:
committed by
Milan Broz
parent
ee57b865b0
commit
83c227d53c
@@ -345,7 +345,7 @@ static int hdr_write_disk(struct crypt_device *cd,
|
||||
LUKS2_HDR_BIN_LEN, offset) < (ssize_t)LUKS2_HDR_BIN_LEN)
|
||||
r = -EIO;
|
||||
|
||||
device_sync(cd, device, devfd);
|
||||
device_sync(cd, device);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
@@ -1256,8 +1256,7 @@ out:
|
||||
crypt_memzero(&tmp_hdr, sizeof(tmp_hdr));
|
||||
crypt_safe_free(buffer);
|
||||
|
||||
if (devfd >= 0)
|
||||
device_sync(cd, device, devfd);
|
||||
device_sync(cd, device);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ static int luks2_encrypt_to_storage(char *src, size_t srcLength,
|
||||
else
|
||||
r = 0;
|
||||
|
||||
device_sync(cd, device, devfd);
|
||||
device_sync(cd, device);
|
||||
} else
|
||||
r = -EIO;
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@ static int move_keyslot_areas(struct crypt_device *cd, off_t offset_from,
|
||||
|
||||
r = 0;
|
||||
out:
|
||||
device_sync(cd, device, devfd);
|
||||
device_sync(cd, device);
|
||||
crypt_memzero(buf, buf_size);
|
||||
free(buf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user