From: Sjoerd Simons Date: Fri, 5 Nov 2021 08:10:51 +0000 (+0100) Subject: hostfs: Fix writeback of dirty pages X-Git-Tag: v5.17-rc1~127^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce72750f04d68a45ef971c3547fe2d6f9cd4756e;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Christopher Obbard Tested-by: Ritesh Raj Sarraf Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger --- diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index d5c9d886cd9f7..ef481c3d90192 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)