mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ritesh Raj Sarraf <ritesh.sarraf@collabora.com>
To: Sjoerd Simons <sjoerd@collabora.com>, linux-um@lists.infradead.org
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Jeff Dike <jdike@addtoit.com>,
	Richard Weinberger <richard@nod.at>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hostfs: Fix writeback of dirty pages
Date: Thu, 11 Nov 2021 22:40:02 +0530	[thread overview]
Message-ID: <ba9a4b5405774f157df790c57d658b9f37e1ae61.camel@collabora.com> (raw)
In-Reply-To: <20211105081052.2353801-1-sjoerd@collabora.com>

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2021-11-11 17:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05  8:10 Sjoerd Simons
2021-11-11 13:26 ` Christopher Obbard
2021-11-11 17:10 ` Ritesh Raj Sarraf [this message]
2021-11-11 18:57 ` Anton Ivanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba9a4b5405774f157df790c57d658b9f37e1ae61.camel@collabora.com \
    --to=ritesh.sarraf@collabora.com \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=sjoerd@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®