hostfs: Fix writeback of dirty pages
Subsystems (2)
PATCH 1/1 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.
---
fs/hostfs/hostfs_kern.c | 3 +++ 1 file changed, 3 insertions(+)
fs/hostfs/hostfs_kern.c +3 -0
@@ -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 )
Signature · 7 lines
2.33.1 _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um
Hi Sjoerd,
Quoted 5 lines · Sjoerd Simons
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.
Quoted 7 lines
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 <[email protected]>
...replying mainly as I wonder if adding the stable tag in a reply will make the patch appear in stable (obviously once it is in mainline) ? :-)
Quoted 12 lines
---
fs/hostfs/hostfs_kern.c | 3 +++ 1 file changed, 3 insertions(+)fs/hostfs/hostfs_kern.c +0
-0
fs/hostfs/hostfs_kern.c static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent) · line 932
Quoted 9 lines
fs/hostfs/hostfs_kern.c +3
-0@@ -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 )
_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Quoted 7 lines · Sjoerd Simons
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.
Quoted 9 lines
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 <[email protected]>
Quoted 20 lines
---
fs/hostfs/hostfs_kern.c | 3 +++
1 file changed, 3 insertions(+)fs/hostfs/hostfs_kern.c +3
-0@@ -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)' byprintf(): avoid that. */ if (req_root== NULL)
Signature · 2 lines
Ritesh Raj Sarraf Collabora
_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Quoted 24 lines · Sjoerd Simons
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 <[email protected]>---
fs/hostfs/hostfs_kern.c | 3 +++ 1 file changed, 3 insertions(+)fs/hostfs/hostfs_kern.c +0
-0
fs/hostfs/hostfs_kern.c static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent) · line 932
Quoted 9 lines
fs/hostfs/hostfs_kern.c +3
-0@@ -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 )
Signature · 3 lines
Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/