reencrypt: use fsync instead of O_DIRECT flag

O_DIRECT operations directed towards filesystem are problematic:
There's no sane way how to detect specific filesystem requirements
for such operations.

This patch is replacing O_DIRECT flag with O_SYNC flag for all
open() calls related to reencrypt log. The O_SYNC flag is used
when --use-fsync option is detected.

Man page is modified accordingly.
This commit is contained in:
Ondrej Kozina
2014-09-17 16:38:39 +02:00
committed by Milan Broz
parent b8beedb621
commit 3d6bcae84c
2 changed files with 6 additions and 12 deletions

View File

@@ -158,13 +158,15 @@ WARNING: This is destructive operation and cannot be reverted.
.TP
.B "\-\-use-directio"
Use direct-io (O_DIRECT) for all read/write data operations.
Use direct-io (O_DIRECT) for all read/write data operations related
to block device undergoing reencryption.
Useful if direct-io operations perform better than normal buffered
operations (e.g. in virtual environments).
.TP
.B "\-\-use-fsync"
Use fsync call after every written block.
Use fsync call after every written block. This applies for reencryption
log files as well.
.TP
.B "\-\-write-log"
Update log file after every block write. This can slow down reencryption