From: Jaegeuk Kim via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 03/27] f2fs: Add f2fs_folio_put()
Date: Thu, 27 Feb 2025 21:31:08 +0000 [thread overview]
Message-ID: <Z8DZnHBF_o8JSkPp@google.com> (raw)
In-Reply-To: <Z7wdb8nnXaUnD0CJ@google.com>
On 02/24, Jaegeuk Kim wrote:
> Hi Matthew,
>
> On 02/21, Jaegeuk Kim wrote:
> > On 02/18, Matthew Wilcox (Oracle) wrote:
> > > Convert f2fs_put_page() to f2fs_folio_put() and add a wrapper.
> > > Replaces three calls to compound_head() with one.
> > >
> > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> > > ---
> > > fs/f2fs/f2fs.h | 15 ++++++++++-----
> > > 1 file changed, 10 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> > > index b05653f196dd..5e01a08afbd7 100644
> > > --- a/fs/f2fs/f2fs.h
> > > +++ b/fs/f2fs/f2fs.h
> > > @@ -2806,16 +2806,21 @@ static inline struct page *f2fs_pagecache_get_page(
> > > return pagecache_get_page(mapping, index, fgp_flags, gfp_mask);
> > > }
> > >
> > > -static inline void f2fs_put_page(struct page *page, int unlock)
> > > +static inline void f2fs_folio_put(struct folio *folio, bool unlock)
> > > {
> > > - if (!page)
> > > + if (!folio)
> > > return;
> > >
> > > if (unlock) {
> > > - f2fs_bug_on(F2FS_P_SB(page), !PageLocked(page));
> > > - unlock_page(page);
> > > + f2fs_bug_on(F2FS_F_SB(folio), !folio_test_locked(folio));
> > > + folio_unlock(folio);
> > > }
> > > - put_page(page);
> > > + folio_put(folio);
> > > +}
> > > +
> > > +static inline void f2fs_put_page(struct page *page, int unlock)
> > > +{
> >
> > I got a kernel panic, since there are still several places to pass a null
> > page pointer, which feeds to page_folio() which doesn't expect the null.
> >
> > Applying this can avoid the panic.
> >
> > if (!page)
> > return;
>
> Please let me know, if you want me to apply this to your patch directly, or post
> v2.
I applied the fix into your patch. Thanks.
>
> Thanks,
>
> >
> > > + f2fs_folio_put(page_folio(page), unlock);
> > > }
> > >
> > > static inline void f2fs_put_dnode(struct dnode_of_data *dn)
> > > --
> > > 2.47.2
> > >
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Chao Yu <chao@kernel.org>,
linux-f2fs-devel@lists.sourceforge.net,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 03/27] f2fs: Add f2fs_folio_put()
Date: Thu, 27 Feb 2025 21:31:08 +0000 [thread overview]
Message-ID: <Z8DZnHBF_o8JSkPp@google.com> (raw)
In-Reply-To: <Z7wdb8nnXaUnD0CJ@google.com>
On 02/24, Jaegeuk Kim wrote:
> Hi Matthew,
>
> On 02/21, Jaegeuk Kim wrote:
> > On 02/18, Matthew Wilcox (Oracle) wrote:
> > > Convert f2fs_put_page() to f2fs_folio_put() and add a wrapper.
> > > Replaces three calls to compound_head() with one.
> > >
> > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> > > ---
> > > fs/f2fs/f2fs.h | 15 ++++++++++-----
> > > 1 file changed, 10 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> > > index b05653f196dd..5e01a08afbd7 100644
> > > --- a/fs/f2fs/f2fs.h
> > > +++ b/fs/f2fs/f2fs.h
> > > @@ -2806,16 +2806,21 @@ static inline struct page *f2fs_pagecache_get_page(
> > > return pagecache_get_page(mapping, index, fgp_flags, gfp_mask);
> > > }
> > >
> > > -static inline void f2fs_put_page(struct page *page, int unlock)
> > > +static inline void f2fs_folio_put(struct folio *folio, bool unlock)
> > > {
> > > - if (!page)
> > > + if (!folio)
> > > return;
> > >
> > > if (unlock) {
> > > - f2fs_bug_on(F2FS_P_SB(page), !PageLocked(page));
> > > - unlock_page(page);
> > > + f2fs_bug_on(F2FS_F_SB(folio), !folio_test_locked(folio));
> > > + folio_unlock(folio);
> > > }
> > > - put_page(page);
> > > + folio_put(folio);
> > > +}
> > > +
> > > +static inline void f2fs_put_page(struct page *page, int unlock)
> > > +{
> >
> > I got a kernel panic, since there are still several places to pass a null
> > page pointer, which feeds to page_folio() which doesn't expect the null.
> >
> > Applying this can avoid the panic.
> >
> > if (!page)
> > return;
>
> Please let me know, if you want me to apply this to your patch directly, or post
> v2.
I applied the fix into your patch. Thanks.
>
> Thanks,
>
> >
> > > + f2fs_folio_put(page_folio(page), unlock);
> > > }
> > >
> > > static inline void f2fs_put_dnode(struct dnode_of_data *dn)
> > > --
> > > 2.47.2
> > >
next prev parent reply other threads:[~2025-02-27 21:31 UTC|newest]
Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 5:51 [f2fs-dev] [PATCH 00/27] f2fs folio conversions for v6.15 Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 01/27] f2fs: Add f2fs_folio_wait_writeback() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 02/27] mm: Remove wait_for_stable_page() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 03/27] f2fs: Add f2fs_folio_put() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-21 4:55 ` [f2fs-dev] " Jaegeuk Kim via Linux-f2fs-devel
2025-02-21 4:55 ` Jaegeuk Kim
2025-02-24 7:19 ` [f2fs-dev] " Jaegeuk Kim via Linux-f2fs-devel
2025-02-24 7:19 ` Jaegeuk Kim
2025-02-27 21:31 ` Jaegeuk Kim via Linux-f2fs-devel [this message]
2025-02-27 21:31 ` Jaegeuk Kim
2025-02-18 5:51 ` [f2fs-dev] [PATCH 04/27] f2fs: Convert f2fs_flush_inline_data() to use a folio Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 05/27] f2fs: Convert f2fs_sync_node_pages() " Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 06/27] f2fs: Pass a folio to flush_dirty_inode() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 07/27] f2fs: Convert f2fs_fsync_node_pages() to use a folio Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 08/27] f2fs: Convert last_fsync_dnode() " Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 09/27] f2fs: Return a folio from last_fsync_dnode() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 10/27] f2fs: Add f2fs_grab_cache_folio() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 11/27] mm: Remove grab_cache_page_write_begin() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 12/27] f2fs: Use a folio in __get_node_page() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 13/27] f2fs: Use a folio in do_write_page() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 14/27] f2fs: Convert f2fs_write_end_io() to use a folio_iter Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 15/27] f2fs: Mark some functions as taking a const page pointer Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 16/27] f2fs: Convert f2fs_in_warm_node_list() to take a folio Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 17/27] f2fs: Add f2fs_get_node_folio() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-03-01 1:15 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-03-01 1:15 ` Chao Yu
2025-03-01 1:59 ` [f2fs-dev] " Matthew Wilcox
2025-03-01 1:59 ` Matthew Wilcox
2025-03-01 2:03 ` [f2fs-dev] " Matthew Wilcox
2025-03-01 2:03 ` Matthew Wilcox
2025-03-03 3:15 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-03-03 3:15 ` Chao Yu
2025-02-18 5:51 ` [f2fs-dev] [PATCH 18/27] f2fs: Use a folio throughout f2fs_truncate_inode_blocks() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 19/27] f2fs: Use a folio throughout __get_meta_page() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 20/27] f2fs: Hoist the page_folio() call to the start of f2fs_merge_page_bio() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-28 7:25 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-02-28 7:25 ` Chao Yu
2025-02-18 5:51 ` [f2fs-dev] [PATCH 21/27] f2fs: Add f2fs_get_read_data_folio() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-28 7:37 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-02-28 7:37 ` Chao Yu
2025-02-18 5:51 ` [f2fs-dev] [PATCH 22/27] f2fs: Add f2fs_get_lock_data_folio() Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-28 7:37 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-02-28 7:37 ` Chao Yu
2025-02-18 5:51 ` [f2fs-dev] [PATCH 23/27] f2fs: Convert move_data_page() to use a folio Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 24/27] f2fs: Convert truncate_partial_data_page() " Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:51 ` [f2fs-dev] [PATCH 25/27] f2fs: Convert gc_data_segment() " Matthew Wilcox (Oracle)
2025-02-18 5:51 ` Matthew Wilcox (Oracle)
2025-02-18 5:52 ` [f2fs-dev] [PATCH 26/27] f2fs: Add f2fs_find_data_folio() Matthew Wilcox (Oracle)
2025-02-18 5:52 ` Matthew Wilcox (Oracle)
2025-02-18 5:52 ` [f2fs-dev] [PATCH 27/27] mm: Remove wait_on_page_locked() Matthew Wilcox (Oracle)
2025-02-18 5:52 ` Matthew Wilcox (Oracle)
2025-02-21 2:27 ` [f2fs-dev] [PATCH 00/27] f2fs folio conversions for v6.15 Jaegeuk Kim via Linux-f2fs-devel
2025-02-21 2:27 ` Jaegeuk Kim
2025-03-04 8:04 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-03-04 8:04 ` Chao Yu
2025-03-04 17:10 ` [f2fs-dev] " patchwork-bot+f2fs--- via Linux-f2fs-devel
2025-03-04 17:10 ` patchwork-bot+f2fs
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=Z8DZnHBF_o8JSkPp@google.com \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=jaegeuk@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=willy@infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.