Re: [Cluster-devel] [PATCH 7/9] gfs2: handle a NULL folio in gfs2_jhead_process_page

2023-01-18 Thread Andreas Gruenbacher
[Christoph's email ended up in my spam folder; I hope that was a one-time-only occurrence.] On Wed, Jan 18, 2023 at 5:00 PM Matthew Wilcox wrote: > On Wed, Jan 18, 2023 at 10:43:27AM +0100, Christoph Hellwig wrote: > > filemap_get_folio can return NULL, so exit early for that case. > > I'm not

Re: [Cluster-devel] [RFC v6 08/10] iomap/xfs: Eliminate the iomap_valid handler

2023-01-09 Thread Andreas Gruenbacher
On Sun, Jan 8, 2023 at 10:59 PM Dave Chinner wrote: > On Sun, Jan 08, 2023 at 08:40:32PM +0100, Andreas Gruenbacher wrote: > > Eliminate the ->iomap_valid() handler by switching to a ->get_folio() > > handler and validating the mapping there. > > > > Signed-o

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-09 Thread Andreas Gruenbacher
On Sun, Jan 8, 2023 at 10:33 PM Dave Chinner wrote: > On Sun, Jan 08, 2023 at 08:40:28PM +0100, Andreas Gruenbacher wrote: > > Add an iomap_get_folio() helper that gets a folio reference based on > > an iomap iterator and an offset into the address space. Use it in > &

[Cluster-devel] [RFC v6 10/10] xfs: Make xfs_iomap_folio_ops static

2023-01-08 Thread Andreas Gruenbacher
Variable xfs_iomap_folio_ops isn't used outside xfs_iomap.c, so it should be static. Signed-off-by: Andreas Gruenbacher Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_iomap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index

[Cluster-devel] [RFC v6 08/10] iomap/xfs: Eliminate the iomap_valid handler

2023-01-08 Thread Andreas Gruenbacher
Eliminate the ->iomap_valid() handler by switching to a ->get_folio() handler and validating the mapping there. Signed-off-by: Andreas Gruenbacher --- fs/iomap/buffered-io.c | 26 +- fs/xfs/xfs_iomap.c | 37 ++--- include/linux/i

[Cluster-devel] [RFC v6 09/10] iomap: Rename page_ops to folio_ops

2023-01-08 Thread Andreas Gruenbacher
The operations in struct page_ops all operate on folios, so rename struct page_ops to struct folio_ops. Signed-off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/gfs2/bmap.c | 4 ++-- fs/iomap/buffered-io.c | 12 ++-- fs/xfs

[Cluster-devel] [RFC v6 05/10] iomap/gfs2: Get page in page_prepare handler

2023-01-08 Thread Andreas Gruenbacher
put_folio() handler now also isn't called with NULL as the folio value anymore. Filesystems are expected to use the iomap_get_folio() helper for getting locked folios in their ->page_prepare() handlers. Signed-off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig

[Cluster-devel] [RFC v6 07/10] iomap: Rename page_prepare handler to get_folio

2023-01-08 Thread Andreas Gruenbacher
The ->page_prepare() handler in struct iomap_page_ops is now somewhat misnamed, so rename it to ->get_folio(). Signed-off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/gfs2/bmap.c | 6 +++--- fs/iomap/buffered-io.c | 4 ++-- include

[Cluster-devel] [RFC v6 06/10] iomap: Add __iomap_get_folio helper

2023-01-08 Thread Andreas Gruenbacher
Add an __iomap_get_folio() helper as the counterpart of the existing __iomap_put_folio() helper. Use the new helper in iomap_write_begin(). Not a functional change. Signed-off-by: Andreas Gruenbacher --- fs/iomap/buffered-io.c | 16 1 file changed, 12 insertions(+), 4

[Cluster-devel] [RFC v6 03/10] iomap: Rename page_done handler to put_folio

2023-01-08 Thread Andreas Gruenbacher
The ->page_done() handler in struct iomap_page_ops is now somewhat misnamed in that it mainly deals with unlocking and putting a folio, so rename it to ->put_folio(). Signed-off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/gfs2/bmap.c

[Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-08 Thread Andreas Gruenbacher
Add an iomap_get_folio() helper that gets a folio reference based on an iomap iterator and an offset into the address space. Use it in iomap_write_begin(). Signed-off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 39

[Cluster-devel] [RFC v6 02/10] iomap/gfs2: Unlock and put folio in page_done handler

2023-01-08 Thread Andreas Gruenbacher
folio in ->page_done(). Signed-off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/gfs2/bmap.c | 15 --- fs/iomap/buffered-io.c | 8 include/linux/iomap.h | 7 --- 3 files changed, 20 insertions(+), 10 deletions(-) d

[Cluster-devel] [RFC v6 01/10] iomap: Add __iomap_put_folio helper

2023-01-08 Thread Andreas Gruenbacher
off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/iomap/buffered-io.c | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 356193e44cf0..c045689b6af8 100

Re: [Cluster-devel] [PATCH v5 5/9] iomap/gfs2: Get page in page_prepare handler

2023-01-08 Thread Andreas Gruenbacher
On Sun, Jan 8, 2023 at 6:29 PM Christoph Hellwig wrote: > > + if (page_ops && page_ops->page_prepare) > > + folio = page_ops->page_prepare(iter, pos, len); > > + else > > + folio = iomap_get_folio(iter, pos); > > + if (IS_ERR(folio)) > > return

[Cluster-devel] [RFC v6 00/10] Turn iomap_page_ops into iomap_folio_ops

2023-01-08 Thread Andreas Gruenbacher
iomap_folio_ops was still referring to pages instead of folios in two places. Is this good enough for iomap-for-next now, please? Thanks, Andreas [*] https://lore.kernel.org/linux-xfs/20221231150919.659533-1-agrue...@redhat.com/ Andreas Gruenbacher (10): iomap: Add __iomap_put_folio helper iomap

Re: [Cluster-devel] [PATCH v5 7/9] iomap/xfs: Eliminate the iomap_valid handler

2023-01-08 Thread Andreas Gruenbacher
On Sun, Jan 8, 2023 at 6:32 PM Christoph Hellwig wrote: > On Wed, Jan 04, 2023 at 07:08:17PM +, Matthew Wilcox wrote: > > On Wed, Jan 04, 2023 at 09:53:17AM -0800, Darrick J. Wong wrote: > > > I wonder if this should be reworked a bit to reduce indenting: > > > > > > if (PTR_ERR(folio) ==

Re: [Cluster-devel] [PATCH v5 17/23] gfs2: Convert gfs2_write_cache_jdata() to use filemap_get_folios_tag()

2023-01-05 Thread Andreas Gruenbacher
get_folios_tag(mapping, , end, > + tag, ); > + if (nr_folios == 0) > break; > > - ret = gfs2_write_jdata_pagevec(mapping, wbc, , nr_pages, > _index); > + ret = gfs2_write_jdata_batch(mapping, wbc, , > + _index); > if (ret) > done = 1; > if (ret > 0) > ret = 0; > - pagevec_release(); > + folio_batch_release(); > cond_resched(); > } > > -- > 2.38.1 > Reviewed-by: Andreas Gruenbacher Thanks, Andreas

[Cluster-devel] [PATCH v5 6/9] iomap: Rename page_prepare handler to get_folio

2022-12-31 Thread Andreas Gruenbacher
The ->page_prepare() handler in struct iomap_page_ops is now somewhat misnamed, so rename it to ->get_folio(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 6 +++--- fs/iomap/buffered-io.c | 4 ++-- include/linux/iomap.h | 6 +++--- 3 files changed, 8 insertions

[Cluster-devel] [PATCH v5 9/9] xfs: Make xfs_iomap_folio_ops static

2022-12-31 Thread Andreas Gruenbacher
Variable xfs_iomap_folio_ops isn't used outside xfs_iomap.c, so it should be static. Signed-off-by: Andreas Gruenbacher --- fs/xfs/xfs_iomap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 5bddf31e21eb..7d1795a9c742 100644

[Cluster-devel] [PATCH v5 8/9] iomap: Rename page_ops to folio_ops

2022-12-31 Thread Andreas Gruenbacher
The operations in struct page_ops all operate on folios, so rename struct page_ops to struct folio_ops. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 4 ++-- fs/iomap/buffered-io.c | 12 ++-- fs/xfs/xfs_iomap.c | 4 ++-- include/linux/iomap.h | 14

[Cluster-devel] [PATCH v5 7/9] iomap/xfs: Eliminate the iomap_valid handler

2022-12-31 Thread Andreas Gruenbacher
Eliminate the ->iomap_valid() handler by switching to a ->get_folio() handler and validating the mapping there. Signed-off-by: Andreas Gruenbacher --- fs/iomap/buffered-io.c | 25 + fs/xfs/xfs_iomap.c | 37 ++--- include/linux/i

[Cluster-devel] [PATCH v5 5/9] iomap/gfs2: Get page in page_prepare handler

2022-12-31 Thread Andreas Gruenbacher
put_folio() handler now also isn't called with NULL as the folio value anymore. Filesystems are expected to use the iomap_get_folio() helper for getting locked folios in their ->page_prepare() handlers. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 21 + fs/io

[Cluster-devel] [PATCH v5 4/9] iomap: Add iomap_get_folio helper

2022-12-31 Thread Andreas Gruenbacher
Add an iomap_get_folio() helper that gets a folio reference based on an iomap iterator and an offset into the address space. Use it in iomap_write_begin(). Signed-off-by: Andreas Gruenbacher --- fs/iomap/buffered-io.c | 39 ++- include/linux/iomap.h | 1

[Cluster-devel] [PATCH v5 0/9] Turn iomap_page_ops into iomap_folio_ops

2022-12-31 Thread Andreas Gruenbacher
t least it makes reviewing the patches easier. If there are no more objections, can this go into iomap-for-next? Thanks, Andreas [*] https://lore.kernel.org/linux-xfs/20221218221054.3946886-1-agrue...@redhat.com/ Andreas Gruenbacher (9): iomap: Add iomap_put_folio helper iomap/gfs2: Unlock and put

[Cluster-devel] [PATCH v5 3/9] iomap: Rename page_done handler to put_folio

2022-12-31 Thread Andreas Gruenbacher
The ->page_done() handler in struct iomap_page_ops is now somewhat misnamed in that it mainly deals with unlocking and putting a folio, so rename it to ->put_folio(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 4 ++-- fs/iomap/buffered-io.c | 4 ++-- include/linux/i

[Cluster-devel] [PATCH v5 1/9] iomap: Add iomap_put_folio helper

2022-12-31 Thread Andreas Gruenbacher
off-by: Andreas Gruenbacher --- fs/iomap/buffered-io.c | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 356193e44cf0..c30d150a9303 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-i

[Cluster-devel] [PATCH v5 2/9] iomap/gfs2: Unlock and put folio in page_done handler

2022-12-31 Thread Andreas Gruenbacher
folio in ->page_done(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 15 --- fs/iomap/buffered-io.c | 8 include/linux/iomap.h | 7 --- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index e75

[Cluster-devel] [RFC v4 7/7] iomap: Rename page_ops to folio_ops

2022-12-18 Thread Andreas Gruenbacher
The operations in struct page_ops all operate on folios, so rename struct page_ops to struct folio_ops, ->page_prepare() to ->folio_prepare(), and ->page_done() to ->folio_done(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 16 fs/iomap/buffer

[Cluster-devel] [RFC v4 5/7] iomap/gfs2: Get page in page_prepare handler

2022-12-18 Thread Andreas Gruenbacher
page_done() handler is now not called with a NULL folio anymore. Filesystems are expected to use the iomap_folio_prepare() helper for getting locked folios in their ->page_prepare() handlers. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 16 +--- fs/iomap/buffer

[Cluster-devel] [RFC v4 6/7] iomap/xfs: Eliminate the iomap_valid handler

2022-12-18 Thread Andreas Gruenbacher
Eliminate the ->iomap_valid() handler by switching to a ->page_prepare() handler and validating the mapping there. Signed-off-by: Andreas Gruenbacher --- fs/iomap/buffered-io.c | 25 + fs/xfs/xfs_iomap.c | 38 +++--- include

[Cluster-devel] [RFC v4 4/7] iomap: Add iomap_folio_prepare helper

2022-12-18 Thread Andreas Gruenbacher
Add an iomap_folio_prepare() helper that gets a folio reference based on an iomap iterator and an offset into the address space. Signed-off-by: Andreas Gruenbacher --- fs/iomap/buffered-io.c | 37 - include/linux/iomap.h | 1 + 2 files changed, 29

[Cluster-devel] [RFC v4 3/7] iomap/gfs2: Unlock and put folio in page_done handler

2022-12-18 Thread Andreas Gruenbacher
folio on filesystems with a block size smaller than the page size.) The only current user of ->page_done() is gfs2, so other filesystems are not affected. Still, to catch out any new users, switch from a page to a folio in ->page_done(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c

[Cluster-devel] [RFC v4 2/7] iomap: Add iomap_folio_done helper

2022-12-18 Thread Andreas Gruenbacher
Add an iomap_folio_done() helper to encapsulate unlocking the folio, calling ->page_done(), and putting the folio. This doesn't change the functionality. Signed-off-by: Andreas Gruenbacher --- fs/iomap/buffered-io.c | 28 +--- 1 file changed, 17 insertions(+),

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

2022-12-18 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 v4 0/7] Turn iomap_page_ops into iomap_folio_ops

2022-12-18 Thread Andreas Gruenbacher
Here's an updated version that changes iomap_folio_prepare() to return an ERR_PTR() instead of NULL when the folio cannot be obtained as suggested by Matthew Wilcox. Thanks, Andreas Andreas Gruenbacher (7): fs: Add folio_may_straddle_isize helper iomap: Add iomap_folio_done helper iomap

Re: [Cluster-devel] [RFC v3 5/7] iomap: Get page in page_prepare handler

2022-12-16 Thread Andreas Gruenbacher
On Fri, Dec 16, 2022 at 5:30 PM Matthew Wilcox wrote: > On Fri, Dec 16, 2022 at 04:06:24PM +0100, Andreas Gruenbacher wrote: > > + if (page_ops && page_ops->page_prepare) > > + folio = page_ops->page_prepare(iter, pos, len); > >

[Cluster-devel] [RFC v3 6/7] iomap/xfs: Eliminate the iomap_valid handler

2022-12-16 Thread Andreas Gruenbacher
Eliminate the ->iomap_valid() handler by switching to a ->page_prepare() handler and validating the mapping there. Signed-off-by: Andreas Gruenbacher --- fs/iomap/buffered-io.c | 24 fs/xfs/xfs_iomap.c | 38 +++--- include

[Cluster-devel] [RFC v3 5/7] iomap: Get page in page_prepare handler

2022-12-16 Thread Andreas Gruenbacher
page_done() handler is now not called with a NULL folio anymore. Filesystems are expected to use the iomap_folio_prepare() helper for getting locked folios in their ->page_prepare() handlers. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 16 +--- fs/iomap/buffer

[Cluster-devel] [RFC v3 4/7] iomap: Add iomap_folio_prepare helper

2022-12-16 Thread Andreas Gruenbacher
Add an iomap_folio_prepare() helper that gets a folio reference based on an iomap iterator and an offset into the address space. Signed-off-by: Andreas Gruenbacher --- fs/iomap/buffered-io.c | 27 +-- include/linux/iomap.h | 1 + 2 files changed, 22 insertions(+), 6

[Cluster-devel] [RFC v3 7/7] iomap: Rename page_ops to folio_ops

2022-12-16 Thread Andreas Gruenbacher
The operations in struct page_ops all operate on folios, so rename struct page_ops to struct folio_ops, ->page_prepare() to ->folio_prepare(), and ->page_done() to ->folio_done(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 16 fs/iomap/buffer

[Cluster-devel] [RFC v3 3/7] iomap/gfs2: Unlock and put folio in page_done handler

2022-12-16 Thread Andreas Gruenbacher
folio on filesystems with a block size smaller than the page size.) The only current user of ->page_done() is gfs2, so other filesystems are not affected. Still, to catch out any new users, switch from a page to a folio in ->page_done(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c

[Cluster-devel] [RFC v3 2/7] iomap: Add iomap_folio_done helper

2022-12-16 Thread Andreas Gruenbacher
Add an iomap_folio_done() helper to encapsulate unlocking the folio, calling ->page_done(), and putting the folio. This doesn't change the functionality. Signed-off-by: Andreas Gruenbacher --- fs/iomap/buffered-io.c | 28 +--- 1 file changed, 17 insertions(+),

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

2022-12-16 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 v3 0/7] Turn iomap_page_ops into iomap_folio_ops

2022-12-16 Thread Andreas Gruenbacher
I've left it in this patch queue for now, but I can moved out of the way if prefered. Any thoughts? Thanks, Andreas Andreas Gruenbacher (7): fs: Add folio_may_straddle_isize helper iomap: Add iomap_folio_done helper iomap/gfs2: Unlock and put folio in page_done handler iomap: Add iomap_fol

[Cluster-devel] [GIT PULL] gfs2 fixes

2022-12-16 Thread Andreas Gruenbacher
ifications. -------- Andreas Gruenbacher (17): gfs2: Add extra error check in alloc_dinode gfs2: Get rid of ghs[] in gfs2_create_inode gfs2: Clean up initialization of "ip" in gfs2_create_inode gfs2: Fix and clean up create / evict interaction

Re: [Cluster-devel] [syzbot] WARNING in iomap_read_inline_data

2022-12-04 Thread Andreas Gruenbacher
On Tue, Nov 29, 2022 at 9:31 PM Dave Chinner wrote: > Looks like something to do with the gfs2 inline data functionality - > syzbot probably corrupted the resource index inode given the > gfs2_fill_super() context. Hmm, interesting. We're not checking the size of inline (stuffed) inodes when

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

2022-12-03 Thread Andreas Gruenbacher
Hello, thank you for this bug report. On Sat, Dec 3, 2022 at 8:28 AM Wangshaobo (bobo) wrote: > 在 2022/12/1 19:50, Wang ShaoBo 写道: > > syzbot has reported an interesting issue: > > > > INFO: task syz-executor888:3126 blocked for more than 143 seconds. > >Not tainted

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 wr

[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

[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 0/3] Turn iomap_page_ops into iomap_folio_ops

2022-12-01 Thread Andreas Gruenbacher
folio_may_straddle_isize() users, namely generic_write_end(), ext4_write_end(), and ext4_journalled_write_end(). Any thoughts? Thanks, Andreas Andreas Gruenbacher (3): fs: Add folio_may_straddle_isize helper iomap: Turn iomap_page_ops into iomap_folio_ops gfs2: Fix race between shrinker

[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/

[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/

[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 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 0/3] Turn iomap_page_ops into iomap_folio_ops

2022-12-01 Thread Andreas Gruenbacher
(), ext4_write_end(), and ext4_journalled_write_end(). Any thoughts? Thanks, Andreas Andreas Gruenbacher (3): fs: Add folio_may_straddle_isize helper iomap: Turn iomap_page_ops into iomap_folio_ops gfs2: Fix race between shrinker and gfs2_iomap_folio_done fs/buffer.c| 5 ++--- fs

[Cluster-devel] [GIT PULL] gfs2 debugfs improvements

2022-10-09 Thread Andreas Gruenbacher
6:28 +0200) gfs2 debugfs improvements - Improve the way how the state of glocks is reported in debugfs for glocks which are not held by processes, but rather by other resouces like cached inodes or flocks. ------

[Cluster-devel] [GIT PULL] gfs2 fixes

2022-10-09 Thread Andreas Gruenbacher
that the sb_bsize and sb_bsize_shift super block fields are consistent with each other. This prevents messy error messages during fuzz testing. - Switch from strlcpy to strscpy. Andreas Gruenbacher (1): gfs2: Switch from strlcpy

Re: [Cluster-devel] [PATCH] gfs2: Register fs after creating workqueues

2022-09-20 Thread Andreas Gruenbacher
On Tue, Aug 30, 2022 at 8:52 PM Bob Peterson wrote: > Before this patch, the gfs2 file system was registered prior to creating > the three workqueues. In some cases this allowed dlm to send recovery > work to a workqueue that did not yet exist because gfs2 was still > initializing. > > This patch

Re: [Cluster-devel] [PATCH] gfs2: Check sb_bsize_shift after reading superblock

2022-09-20 Thread Andreas Gruenbacher
On Wed, Aug 17, 2022 at 3:17 PM Andrew Price wrote: > Fuzzers like to scribble over sb_bsize_shift but in reality it's very > unlikely that this field would be corrupted on its own. Nevertheless it > should be checked to avoid the possibility of messy mount errors due to > bad calculations. It's

Re: [Cluster-devel] [PATCH v2 04/14] gfs2: replace ll_rw_block()

2022-09-05 Thread Andreas Gruenbacher
< 0) > + goto unlock_out; > if (gfs2_is_jdata(ip)) > gfs2_trans_add_data(ip->i_gl, bh); > else > -- > 2.31.1 > Thanks for this fix; looking good. Reviewed-by: Andreas Gruenbacher Andreas

Re: [Cluster-devel] [PATCH] gfs2: move from strlcpy with unused retval to strscpy

2022-08-26 Thread Andreas Gruenbacher
Wolfram and Andy, On Thu, Aug 25, 2022 at 11:33 AM Andrew Price wrote: > On 24/08/2022 21:08, Wolfram Sang wrote: > > Hi Andy. > > > >>> - strlcpy(sdp->sd_proto_name, proto, GFS2_FSNAME_LEN); > >>> - strlcpy(sdp->sd_table_name, table, GFS2_FSNAME_LEN); > >>> + strscpy(sdp->sd_proto_name,

Re: [Cluster-devel] kernel BUG in gfs2_fill_super

2022-08-26 Thread Andreas Gruenbacher
On Tue, Aug 23, 2022 at 3:52 AM 王海弛 wrote: > Dear Linux maintainers and reviewers: > > We would like to report a linux kernel bug, found by a modified version of > syzkaller. > > May affected file: fs/gfs2/ops_fstype.c Thank you. Andreas

Re: [Cluster-devel] [PATCH] gfs2: Use TRY lock in gfs2_inode_lookup for UNLINKED inodes

2022-08-25 Thread Andreas Gruenbacher
l > gfs2_inode_lookup() with -EAGAIN so that delete_work_func() can retry > the operation later. > > Signed-off-by: Bob Peterson > Signed-off-by: Andreas Gruenbacher > --- > fs/gfs2/glock.c | 8 +--- > fs/gfs2/inode.c | 10 -- > 2 files changed, 13 insertions(+),

Re: [Cluster-devel] [GFS2 v3 PATCH 0/3] gfs2: Misc withdraw patches (version 3)

2022-08-25 Thread Andreas Gruenbacher
On Thu, Aug 18, 2022 at 8:32 PM Bob Peterson wrote: > This is version 3 which has further simplification and improvements. > > This patch set fixes a few bugs in how gfs2 handles file systems after > withdraw. In an ideal world, after a file system is withdrawn, users > should be able to unmount

[Cluster-devel] [GIT PULL] gfs2 fixes

2022-08-05 Thread Andreas Gruenbacher
. Make sure all glocks are left in a consistent state. - Various other minor cleanups and fixes. Andreas Gruenbacher (9): gfs2: Minor gfs2_glock_nq_m cleanup gfs2: Fix up gfs2_glock_async_wait gfs2: Instantiate glocks

Re: [Cluster-devel] [PATCH 3/3] gfs2: Clear GLF_LOCK when withdraw prevents xmote

2022-08-05 Thread Andreas Gruenbacher
Bob, On Tue, Aug 2, 2022 at 7:58 PM Bob Peterson wrote: > There are a couple places in function do_xmote where normal processing > is circumvented due to withdraws in progress. However, since we bypass > most of do_xmote() we bypass telling dlm to lock the dlm lock, which > means dlm will never

Re: [Cluster-devel] [PATCH 2/3] gfs2: Dequeue waiters when withdrawn

2022-08-02 Thread Andreas Gruenbacher
On Wed, Jul 27, 2022 at 6:24 PM Bob Peterson wrote: > When a withdraw occurs, ordinary (not system) glocks may not be granted > anymore. This patch takes measures to remove any pending waiters from > the glocks that will never be granted. You kind of explain why this patch is useful in the cover

Re: [Cluster-devel] [PATCH 1/3] gfs2: Prevent double iput for journal on error

2022-08-02 Thread Andreas Gruenbacher
On Wed, Jul 27, 2022 at 6:32 PM Bob Peterson wrote: > When a gfs2 file system is withdrawn, it requests recovery from another > cluster node. To do that, it evicts its journal from memory, but it > keeps the journal entry queued to the journals queue, jindex_list. After > recovery it tries to

Re: [Cluster-devel] [PATCH 1/4] gfs2: stop using generic_writepages in gfs2_ail1_start_one

2022-07-11 Thread Andreas Gruenbacher
r cgroup writeback. Reviewed-by: Andreas Gruenbacher I assume you want to push this through the xfs tree. Can you add the below follow-up cleanup? Thanks, Andreas --- fs/gfs2/log.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c

[Cluster-devel] [PATCH 0/9] gfs2: glock instantiation and holder auto-demotion fixes

2022-06-29 Thread Andreas Gruenbacher
found the remaining bug in the glock holder auto-demotion feature we've disabled for 5.18; fix that and re-enable the feature. Thanks, Andreas Andreas Gruenbacher (8): gfs2: Fix up gfs2_glock_async_wait gfs2: Instantiate glocks ouside of glock state engine gfs2: Revert 'Fix "truncate in pro

[Cluster-devel] [PATCH 1/9] gfs2: Fix up gfs2_glock_async_wait

2022-06-29 Thread Andreas Gruenbacher
ementation doesn't keep that promise if individual locking requests fail. Fix that as well. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 53 ++--- 1 file changed, 15 insertions(+), 38 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glo

[Cluster-devel] [PATCH 6/9] gfs2: Use better variable name

2022-06-29 Thread Andreas Gruenbacher
In do_promote() and add_to_queue(), use current_gh as the variable name for the first strong holder we could find: this matches the variable name is may_grant(), and more clearly indicates that we're interested in one (any) of the current strong holders. Signed-off-by: Andreas Gruenbacher

[Cluster-devel] [PATCH 9/9] Revert "gfs2: Stop using glock holder auto-demotion for now"

2022-06-29 Thread Andreas Gruenbacher
With the glock holder auto-demotion in do_promote fixed, we can re-enable this feature. This reverts commit e1fa9ea85ce89207d2ac0316da35a4a7736801f9. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/file.c | 46 -- 1 file changed, 32 insertions(+), 14

[Cluster-devel] [PATCH 2/9] gfs2: Instantiate glocks ouside of glock state engine

2022-06-29 Thread Andreas Gruenbacher
function in the quota daemon. Waiting for the completion of the truncate was previously done by the glock state engine, but we now need to wait in inode_go_instantiate(). This also means that gfs2_instantiate() will now no longer return any "special" error codes. Signed-off-by: Andreas G

[Cluster-devel] [PATCH 7/9] gfs2: do_promote glock holder stealing fix

2022-06-29 Thread Andreas Gruenbacher
in demote_incompat_holders(); after all, the HIF_HOLDER flag is already set, which means the new holder is already a current holder. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git

[Cluster-devel] [PATCH 4/9] gfs2: Add new go_held glock operation

2022-06-29 Thread Andreas Gruenbacher
is actually only called once, when the glock is instantiated. To fix that, introduce a new go_held glock operation that is called each time a glock holder is acquired. Move the holder specific code in inode_go_instantiate() over to inode_go_held(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c

[Cluster-devel] [PATCH 8/9] gfs2: List traversal in do_promote is safe

2022-06-29 Thread Andreas Gruenbacher
In do_promote(), we're never removing the current entry from the list and so the list traversal is actually safe. Switch back to list_for_each_entry(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/glock.c

[Cluster-devel] [PATCH 5/9] gfs2: Make go_instantiate take a glock

2022-06-29 Thread Andreas Gruenbacher
Make go_instantiate take a glock instead of a glock holder as its argument: this handler is supposed to instantiate the object associated with the glock. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 2 +- fs/gfs2/glops.c | 3 +-- fs/gfs2/incore.h | 2 +- fs/gfs2/rgrp.c | 3

[Cluster-devel] [PATCH 3/9] gfs2: Revert 'Fix "truncate in progress" hang'

2022-06-29 Thread Andreas Gruenbacher
813e0c46c9e2 ("GFS2: Fix "truncate in progress" hang"). Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 41 + fs/gfs2/glock.h | 2 -- fs/gfs2/glops.c | 11 ++- fs/gfs2/incore.h

[Cluster-devel] [PATCH 1/5] gfs2: Add glockfd debugfs file

2022-06-28 Thread Andreas Gruenbacher
task using task_lookup_next_fd_rcu(). To make that work from gfs2, export those two functions. Signed-off-by: Andreas Gruenbacher Cc: Eric W. Biederman Cc: cluster-devel@redhat.com Cc: linux-ker...@vger.kernel.org Cc: linux-fsde...@vger.kernel.org --- fs/file.c | 1 + fs/gfs2/glo

[Cluster-devel] [PATCH 4/5] gfs2: Mark flock glock holders as GL_NOPID

2022-06-28 Thread Andreas Gruenbacher
Add the GL_NOPID flag for flock glock holders. Clean up the flag setting code in do_flock. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/file.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 25f4080bc973..1383f9598011 100644

[Cluster-devel] [PATCH 3/5] gfs2: Add GL_NOPID flag for process-independent glock holders

2022-06-28 Thread Andreas Gruenbacher
actual bug. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 41 +++-- fs/gfs2/glock.h | 1 + 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index aa35f5d4eb54..480b3d2b00e8 100644 --- a/fs/gfs2/glock.

[Cluster-devel] [PATCH 2/5] gfs2: Add flocks to glockfd debugfs file

2022-06-28 Thread Andreas Gruenbacher
on flock operations. Instead, use the file->f_lock spin lock to protect the f_fl_gh.gh_gl glock pointer. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/file.c | 22 -- fs/gfs2/glock.c | 23 +++ 2 files changed, 43 insertions(+), 2 deletions(-) diff -

[Cluster-devel] [PATCH 5/5] gfs2: Mark the remaining process-independent glock holders as GL_NOPID

2022-06-28 Thread Andreas Gruenbacher
Add the GL_NOPID flag for the remaining glock holders which are not associated with the current process. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/inode.c | 6 -- fs/gfs2/ops_fstype.c | 14 -- fs/gfs2/super.c | 3 ++- fs/gfs2/util.c | 6 -- 4 files

[Cluster-devel] [PATCH 0/5] gfs2: debugfs PID reporting improvements

2022-06-28 Thread Andreas Gruenbacher
ch is made easier by exporting find_ge_pid() and task_lookup_next_fd_rcu(); copying Eric W. Biederman and the linux-kernel and linux-fsdevel lists to make sure that's okay. Thanks, Andreas Andreas Gruenbacher (5): gfs2: Add glockfd debugfs file gfs2: Add flocks to glockfd debugfs file gfs2:

[Cluster-devel] [PATCH] gfs2: Minor gfs2_glock_nq_m cleanup

2022-06-28 Thread Andreas Gruenbacher
Add state and flags arguments to gfs2_rlist_alloc() to make it somewhat more obvious which state and flags an rlist uses. With that, stop knocking off flags in gfs2_glock_nq_m() and its nq_m_sync() helper that are never set in the first place. Signed-off-by: Andreas Gruenbacher --- fs/gfs2

[Cluster-devel] [PATCH] gfs2: Minor gfs2_glock_nq_m cleanup

2022-06-28 Thread Andreas Gruenbacher
Add state and flags arguments to gfs2_rlist_alloc() to make it somewhat more obvious which state and flags an rlist uses. With that, stop knocking off flags in gfs2_glock_nq_m() and its nq_m_sync() helper that are never set in the first place. Signed-off-by: Andreas Gruenbacher --- fs/gfs2

Re: [Cluster-devel] [PATCH] gfs2: fix overread in the strlcpy of init_names

2022-06-28 Thread Andreas Gruenbacher
Dongliang Mu, On Tue, Jun 28, 2022 at 8:10 AM Dongliang Mu wrote: > From: Dongliang Mu > > In init_names, strlcpy will overread the src string as the src string is > less than GFS2_FSNAME_LEN(256). > > Fix this by modifying strlcpy back to snprintf, reverting > the commit 00377d8e3842. ... if

Re: [Cluster-devel] Mounting lock_nolock file systems?

2022-06-23 Thread Andreas Gruenbacher
On Wed, Jun 22, 2022 at 4:32 PM Christoph Hellwig wrote: > On Tue, Jun 21, 2022 at 02:58:57PM +0200, Christoph Hellwig wrote: > > Sorry, actually it was the pagecache for-next branch from willy. Looks > > like mainline itself is fine. > > > > I'll try to get the superblock information from the

Re: [Cluster-devel] [PATCH] gfs2: Fix spelling mistake

2022-06-23 Thread Andreas Gruenbacher
On Thu, Jun 23, 2022 at 11:41 AM Zhang Jiaming wrote: > Change 'accomodate' to 'accommodate'. Applied, thanks. Andreas

Re: [Cluster-devel] Mounting lock_nolock file systems?

2022-06-21 Thread Andreas Gruenbacher
On Tue, Jun 21, 2022 at 11:14 AM Christoph Hellwig wrote: > > I'm felling a little stupid, but in the past after a > > mkfs.gfs2 -O -p lock_nolock > > I could just mount the created file system locally. > > On current mainline that does not seem to work any more, what am I > missing? > > Here is

Re: [Cluster-devel] gfs2 is unhappy on pagecache/for-next

2022-06-20 Thread Andreas Gruenbacher
On Mon, Jun 20, 2022 at 8:21 AM Christoph Hellwig wrote: > On Sun, Jun 19, 2022 at 01:15:06PM +0100, Matthew Wilcox wrote: > > On Sun, Jun 19, 2022 at 09:05:59AM +0200, Christoph Hellwig wrote: > > > When trying to run xfstests on gfs2 (locally with the lock_nolock > > > cluster managed) the

Re: [Cluster-devel] [PATCH] gfs2: Remove redundant NULL check before kfree

2022-06-02 Thread Andreas Gruenbacher
On Thu, Jun 2, 2022 at 9:19 AM wrote: > From: Minghao Chi > > kfree on NULL pointer is a no-op. > > Reported-by: Zeal Robot > Signed-off-by: Minghao Chi > --- > fs/gfs2/file.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c > index

[Cluster-devel] [GIT PULL] gfs2 fixes

2022-05-24 Thread Andreas Gruenbacher
. Andreas Gruenbacher (1): gfs2: Explain some direct I/O oddities Andrew Price (1): gfs2: Return more useful errors from gfs2_rgrp_send_discards() Bob Peterson (2): gfs2: use i_lock spin_lock for inode qadata gfs2: Convert function bh_get to use iomap

Re: [Cluster-devel] [PATCH] gfs2: Move iomap_get before taking sd_quota_mutex

2022-05-17 Thread Andreas Gruenbacher
Hi Bob, On Fri, Feb 11, 2022 at 4:51 PM Bob Peterson wrote: > Before this patch quota function bh_get called gfs2_iomap_get after it > had locked the sd_quota_mutex. That's a problem because that holds the > i_rw_mutex, and that lock order is different from other code that > locks i_rw_mutex

[Cluster-devel] [PATCH] *

2022-05-17 Thread Andreas Gruenbacher
Hi Bob, On Fri, Feb 11, 2022 at 4:51 PM Bob Peterson wrote: > Before this patch quota function bh_get called gfs2_iomap_get after it > had locked the sd_quota_mutex. That's a problem because that holds the > i_rw_mutex, and that lock order is different from other code that > locks i_rw_mutex

Re: [Cluster-devel] [PATCH] gfs2: Convert function bh_get to use iomap

2022-05-17 Thread Andreas Gruenbacher
On Fri, Feb 11, 2022 at 4:51 PM Bob Peterson wrote: > Before this patch, function bh_get used block_map to figure out the > block it needed to read in from the quota_change file. This patch > changes it to use iomap directly to make it more efficient. Thanks, I've applied this with minor

Re: [Cluster-devel] [PATCH RESEND] gfs2: Return more useful errors from gfs2_rgrp_send_discards()

2022-05-17 Thread Andreas Gruenbacher
On Mon, May 9, 2022 at 12:41 PM Andrew Price wrote: > On 29/04/2022 15:08, Andrew Price wrote: > > On 19/04/2022 16:49, Andrew Price wrote: > >> On 05/04/2022 13:08, Andrew Price wrote: > >>> The bug that 27ca8273f ("gfs2: Make sure FITRIM minlen is rounded up to > >>> fs block size") fixes was a

[Cluster-devel] [GIT PULL] gfs2 fixes

2022-05-13 Thread Andreas Gruenbacher
- gfs2 fixes - Fix filesystem block deallocation for short writes. - Stop using glock holder auto-demotion for now. - Get rid of buffered writes inefficiencies due to page faults being disabled. - Minor other cleanups. -------- An

<    1   2   3   4   5   6   7   8   9   10   >