[Devel] [PATCH RHEL7 COMMIT] ploop: fix dio_fsync wait

Konstantin Khorenko khorenko at odin.com
Mon May 18 21:26:55 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.1
------>
commit 732676a0eafac636b18f060f06b79312e0ad829d
Author: Andrey Smetanin <asmetanin at virtuozzo.com>
Date:   Tue May 19 08:26:55 2015 +0400

    ploop: fix dio_fsync wait
    
    we MUST wait for writeback to finish before file->f_op->fsync.
    
    https://jira.sw.ru/browse/PSBM-18049
    
    Signed-off-by: Dmitry Monakhov <dmonakhov at openvz.org>
    
    Acked-by: Maxim V. Patlasov <mpatlasov at parallels.com>
---
 drivers/block/ploop/io_direct.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/block/ploop/io_direct.c b/drivers/block/ploop/io_direct.c
index cbb7edc..a9910ba 100644
--- a/drivers/block/ploop/io_direct.c
+++ b/drivers/block/ploop/io_direct.c
@@ -774,16 +774,13 @@ static int dio_fsync(struct file * file)
 	int err, ret;
 	struct address_space *mapping = file->f_mapping;
 
-	ret = filemap_fdatawrite(mapping);
+	ret = filemap_write_and_wait(mapping);
 	err = 0;
 	if (file->f_op && file->f_op->fsync) {
 		err = file->f_op->FOP_FSYNC(file, 0);
 		if (!ret)
 			ret = err;
 	}
-	err = filemap_fdatawait(mapping);
-	if (!ret)
-		ret = err;
 	return ret;
 }
 



More information about the Devel mailing list