Dima,
Just to let me understand the patch better, can you please give a
call-path for "forcing transaction commit" in ordinary ext4 life-cycle
(without ploop) when it handles O_DIRECT write(2) to an uninitialized
extent?
Thanks,
Maxim
On 04/27/2016 07:42 AM, Dmitry Monakhov wrote:
Once we converted extent to initialized it can be part of uncompleted
journal transaction, so we have to force transaction commit at some point.
The easiest way to do it is to perform unconditional fsync.
https://jira.sw.ru/browse/PSBM-45326
TODO: This case and others can be optimized by deferring fsync.But this is
subject of another patch.
Signed-off-by: Dmitry Monakhov <[email protected]>
---
drivers/block/ploop/io_direct.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/block/ploop/io_direct.c b/drivers/block/ploop/io_direct.c
index 8032999..5a2e12a 100644
--- a/drivers/block/ploop/io_direct.c
+++ b/drivers/block/ploop/io_direct.c
@@ -523,6 +523,8 @@ dio_post_submit(struct ploop_io *io, struct ploop_request *
preq)
err = io->files.file->f_op->fallocate(io->files.file,
FALLOC_FL_CONVERT_UNWRITTEN,
(loff_t)sec << 9, clu_siz);
+ if (!err)
+ err = io->files.file->f_op->FOP_FSYNC(io->files.file, 0);
file_end_write(io->files.file);
if (err) {
PLOOP_REQ_SET_ERROR(preq, err);
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel