Skip to content

Commit

Permalink
linstor: Fix to add sync to DD
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Thenot <[email protected]>
  • Loading branch information
Nambrok committed Nov 12, 2024
1 parent eae2679 commit c0e932b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def zeroOut(path, fromByte, bytes):
bytesBefore = bytes
bytes -= bytesBefore
cmd = [CMD_DD, "if=/dev/zero", "of=%s" % path, "bs=1",
"seek=%s" % fromByte, "count=%s" % bytesBefore]
"seek=%s" % fromByte, "count=%s" % bytesBefore, "conv=fsync"]
try:
pread2(cmd)
except CommandException:
Expand All @@ -621,15 +621,15 @@ def zeroOut(path, fromByte, bytes):
fromByte = (fromBlock + blocks) * blockSize
if blocks:
cmd = [CMD_DD, "if=/dev/zero", "of=%s" % path, "bs=%s" % blockSize,
"seek=%s" % fromBlock, "count=%s" % blocks]
"seek=%s" % fromBlock, "count=%s" % blocks, "conv=fsync"]
try:
pread2(cmd)
except CommandException:
return False

if bytes:
cmd = [CMD_DD, "if=/dev/zero", "of=%s" % path, "bs=1",
"seek=%s" % fromByte, "count=%s" % bytes]
"seek=%s" % fromByte, "count=%s" % bytes, "conv=fsync"]
try:
pread2(cmd)
except CommandException:
Expand Down

0 comments on commit c0e932b

Please sign in to comment.