summaryrefslogtreecommitdiff
path: root/fs/hostfs/hostfs_kern.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd@collabora.com>2021-11-05 11:10:51 +0300
committerRichard Weinberger <richard@nod.at>2021-12-21 23:44:27 +0300
commitce72750f04d68a45ef971c3547fe2d6f9cd4756e (patch)
tree3ba3c76130e5f64d6280a394682a1ff69099e4ba /fs/hostfs/hostfs_kern.c
parent9b0da3f22307af693be80f5d3a89dc4c7f360a85 (diff)
downloadlinux-ce72750f04d68a45ef971c3547fe2d6f9cd4756e.tar.xz
hostfs: Fix writeback of dirty pages
Hostfs was not setting up the backing device information, which means it uses the noop bdi. The noop bdi does not have the writeback capability enabled, which in turns means dirty pages never got written back to storage. In other words programs using mmap to write to files on hostfs never actually got their data written out... Fix this by simply setting up the bdi with default settings as all the required code for writeback is already in place. Signed-off-by: Sjoerd Simons <sjoerd@collabora.com> Reviewed-by: Christopher Obbard <chris.obbard@collabora.com> Tested-by: Ritesh Raj Sarraf <ritesh@collabora.com> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/hostfs/hostfs_kern.c')
-rw-r--r--fs/hostfs/hostfs_kern.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index d5c9d886cd9f..ef481c3d9019 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -924,6 +924,9 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
sb->s_op = &hostfs_sbops;
sb->s_d_op = &simple_dentry_operations;
sb->s_maxbytes = MAX_LFS_FILESIZE;
+ err = super_setup_bdi(sb);
+ if (err)
+ goto out;
/* NULL is printed as '(null)' by printf(): avoid that. */
if (req_root == NULL)