Re: [Cluster-devel] [RFC v2 0/3] Turn iomap_page_ops into iomap_folio_ops

2022-12-01 Thread Dave Chinner
On Thu, Dec 01, 2022 at 07:09:54PM +0100, Andreas Gruenbacher wrote: > Hi again, > > [Same thing, but with the patches split correctly this time.] > > we're seeing a race between journaled data writes and the shrinker on > gfs2. What's happening is that gfs2_iomap_page_done() is called after >

[Cluster-devel] [RFC PATCH] gfs2: Fix missing cleanup quota in gfs2_put_super()

2022-12-01 Thread Wang ShaoBo
syzbot has reported an interesting issue: INFO: task syz-executor888:3126 blocked for more than 143 seconds. Not tainted 6.1.0-rc6-syzkaller-32662-g6d464646530f #0 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:syz-executor888 state:D stack:0 pid:3126

Re: [Cluster-devel] [RFC v2 0/3] Turn iomap_page_ops into iomap_folio_ops

2022-12-01 Thread Andreas Gruenbacher
On Thu, Dec 1, 2022 at 10:30 PM Dave Chinner wrote: > On Thu, Dec 01, 2022 at 07:09:54PM +0100, Andreas Gruenbacher wrote: > > Hi again, > > > > [Same thing, but with the patches split correctly this time.] > > > > we're seeing a race between journaled data writes and the shrinker on > > gfs2.

[Cluster-devel] [RFC 1/3] fs: Add folio_may_straddle_isize helper

2022-12-01 Thread Andreas Gruenbacher
Add a folio_may_straddle_isize() helper as a replacement for pagecache_isize_extended() when we have a locked folio. Use the new helper in generic_write_end(), iomap_write_end(), ext4_write_end(), and ext4_journalled_write_end(). Signed-off-by: Andreas Gruenbacher --- fs/buffer.c|

[Cluster-devel] [RFC 3/3] gfs2: Fix race between shrinker and gfs2_iomap_folio_done

2022-12-01 Thread Andreas Gruenbacher
In gfs2_iomap_folio_done(), add the modified buffer heads to the current transaction while the folio is still locked. Otherwise, the shrinker can come in and free them before we get to gfs2_page_add_databufs(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 7 +++ 1 file changed,

[Cluster-devel] [RFC 2/3] iomap: Turn iomap_page_ops into iomap_folio_ops

2022-12-01 Thread Andreas Gruenbacher
Rename the iomap page_ops into folio_ops, and rename the operations accordingly. Move looking up the folio into ->folio_prepare(), and unlocking and putting the folio into ->folio_done(). We'll need the added flexibility in gfs2. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c |

[Cluster-devel] [RFC 0/3] Turn iomap_page_ops into iomap_folio_ops

2022-12-01 Thread Andreas Gruenbacher
Hello, we're seeing a race between journaled data writes and the shrinker on gfs2. What's happening is that gfs2_iomap_page_done() is called after the page has been unlocked, so try_to_free_buffers() can come in and free the buffers while gfs2_iomap_page_done() is trying to add them to the

[Cluster-devel] [RFC v2 0/3] Turn iomap_page_ops into iomap_folio_ops

2022-12-01 Thread Andreas Gruenbacher
Hi again, [Same thing, but with the patches split correctly this time.] we're seeing a race between journaled data writes and the shrinker on gfs2. What's happening is that gfs2_iomap_page_done() is called after the page has been unlocked, so try_to_free_buffers() can come in and free the

[Cluster-devel] [RFC v2 2/3] iomap: Turn iomap_page_ops into iomap_folio_ops

2022-12-01 Thread Andreas Gruenbacher
Rename the iomap page_ops into folio_ops, and rename the operations accordingly. Move looking up the folio into ->folio_prepare(), and unlocking and putting the folio into ->folio_done(). We'll need the added flexibility in gfs2. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c |

[Cluster-devel] [RFC v2 3/3] gfs2: Fix race between shrinker and gfs2_iomap_folio_done

2022-12-01 Thread Andreas Gruenbacher
In gfs2_iomap_folio_done(), add the modified buffer heads to the current transaction while the folio is still locked. Otherwise, the shrinker can come in and free them before we get to gfs2_page_add_databufs(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 7 +++ 1 file changed,

[Cluster-devel] [RFC v2 1/3] fs: Add folio_may_straddle_isize helper

2022-12-01 Thread Andreas Gruenbacher
Add a folio_may_straddle_isize() helper as a replacement for pagecache_isize_extended() when we have a locked folio. Use the new helper in generic_write_end(), iomap_write_end(), ext4_write_end(), and ext4_journalled_write_end(). Signed-off-by: Andreas Gruenbacher --- fs/buffer.c|