aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Weinberger2013-08-04 17:23:51 +0000
committerRichard Weinberger2013-09-07 10:38:29 +0200
commit65984ff9d2179a97e5a11aaef1e86fdb276cfad5 (patch)
treeee545bde7f3924570faa3fdd57b89c59ef13b7f9
parent6e4664525b1db28f8c4e1130957f70a94c19213e (diff)
um: hostfs: Fix writeback
We have to implement ->release() and trigger writeback from it. Otherwise we might lose dirty pages at munmap(). Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--fs/hostfs/hostfs_kern.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index cddb05217512..25437280a207 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -361,6 +361,13 @@ retry:
return 0;
}
+static int hostfs_file_release(struct inode *inode, struct file *file)
+{
+ filemap_write_and_wait(inode->i_mapping);
+
+ return 0;
+}
+
int hostfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{
struct inode *inode = file->f_mapping->host;
@@ -386,7 +393,7 @@ static const struct file_operations hostfs_file_fops = {
.write = do_sync_write,
.mmap = generic_file_mmap,
.open = hostfs_file_open,
- .release = NULL,
+ .release = hostfs_file_release,
.fsync = hostfs_fsync,
};