lkml.org 
[lkml]   [2021]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] hostfs: Fix writeback of dirty pages
From
Date
On Fri, 2021-11-05 at 09:10 +0100, Sjoerd Simons wrote:
> 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>
>

Tested-by: Ritesh Raj Sarraf <ritesh@collabora.com>

> ---
>
>  fs/hostfs/hostfs_kern.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> 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)

--
Ritesh Raj Sarraf
Collabora
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-11-11 18:11    [W:0.208 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site