mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
fix(writer): Set flags manually to avoid verifying cache (#1875)
We change from using `rs+` to a composition of read/write, exlusive, sync & direct i/o flags, in order to avoid reading stale data from the cache during verification. Change-Type: patch Changelog-Entry: Fix verification step reading from the cache
This commit is contained in:
parent
4e891151f4
commit
69c3d61c28
@ -75,7 +75,15 @@ exports.writeImage = (imagePath, drive, options, onProgress) => {
|
||||
}).then(() => {
|
||||
return diskpart.clean(drive.device)
|
||||
}).then(() => {
|
||||
return fs.openAsync(drive.raw, 'rs+')
|
||||
/* eslint-disable no-bitwise */
|
||||
const flags = fs.constants.O_RDWR |
|
||||
fs.constants.O_EXCL |
|
||||
fs.constants.O_NONBLOCK |
|
||||
fs.constants.O_SYNC |
|
||||
fs.constants.O_DIRECT
|
||||
/* eslint-enable no-bitwise */
|
||||
|
||||
return fs.openAsync(drive.raw, flags)
|
||||
}).then((driveFileDescriptor) => {
|
||||
return imageStream.getFromFilePath(imagePath).then((image) => {
|
||||
if (!constraints.isDriveLargeEnough(drive, image)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user