aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2013-10-10 09:19:06 -0400
committerMiklos Szeredi <mszeredi@suse.cz>2014-04-02 09:38:49 -0400
commite7cc133c370f541fa16723ad7df24de375c26fce (patch)
treecf50cb96cb5e950478664b54581c022496b8b9bd /fs/fuse
parentb0aa760652179072119582375f8dc896ed5b5dfd (diff)
fuse: Flush files on wb close
Any write request requires a file handle to report to the userspace. Thus when we close a file (and free the fuse_file with this info) we have to flush all the outstanding dirty pages. filemap_write_and_wait() is enough because every page under fuse writeback is accounted in ff->count. This delays actual close until all fuse wb is completed. In case of "write cache" turned off, the flush is ensured by fuse_vma_close(). Signed-off-by: Maxim Patlasov <MPatlasov@parallels.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 69de9b860c39..530b1e804a32 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -308,6 +308,12 @@ static int fuse_open(struct inode *inode, struct file *file)
308 308
309static int fuse_release(struct inode *inode, struct file *file) 309static int fuse_release(struct inode *inode, struct file *file)
310{ 310{
311 struct fuse_conn *fc = get_fuse_conn(inode);
312
313 /* see fuse_vma_close() for !writeback_cache case */
314 if (fc->writeback_cache)
315 filemap_write_and_wait(file->f_mapping);
316
311 if (test_bit(FUSE_I_MTIME_DIRTY, &get_fuse_inode(inode)->state)) 317 if (test_bit(FUSE_I_MTIME_DIRTY, &get_fuse_inode(inode)->state))
312 fuse_flush_mtime(file, true); 318 fuse_flush_mtime(file, true);
313 319