Wrapfs: call filemap_write_and_wait in ->flush
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 19 Nov 2013 22:20:31 +0000 (17:20 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Dec 2016 03:53:12 +0000 (22:53 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/wrapfs/file.c

index 2aefae408c4639a4e1f616abf87562b42cb23744..272b64cb9d5dd26be3370518d0cc722466d61952 100644 (file)
@@ -210,8 +210,10 @@ static int wrapfs_flush(struct file *file, fl_owner_t id)
        struct file *lower_file = NULL;
 
        lower_file = wrapfs_lower_file(file);
-       if (lower_file && lower_file->f_op && lower_file->f_op->flush)
+       if (lower_file && lower_file->f_op && lower_file->f_op->flush) {
+               filemap_write_and_wait(file->f_mapping);
                err = lower_file->f_op->flush(lower_file, id);
+       }
 
        return err;
 }