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 119dc63 commit 24dbf91
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 @@ -575,7 +575,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:
text = pread2(cmd)
except CommandException:
Expand All @@ -586,15 +586,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:
text = 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:
text = pread2(cmd)
except CommandException:
Expand Down

0 comments on commit 24dbf91

Please sign in to comment.