lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMgjq7CGhkgfOhCEEBKrto82jPVzwHib6skVwnnwJbMExEh5xw@mail.gmail.com>
Date: Mon, 28 Apr 2025 10:14:03 +0800
From: Kairui Song <ryncsn@...il.com>
To: Qu Wenruo <quwenruo.btrfs@....com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>, 
	Matthew Wilcox <willy@...radead.org>, David Hildenbrand <david@...hat.com>, Hugh Dickins <hughd@...gle.com>, 
	Chris Li <chrisl@...nel.org>, Yosry Ahmed <yosryahmed@...gle.com>, 
	"Huang, Ying" <ying.huang@...ux.alibaba.com>, Nhat Pham <nphamcs@...il.com>, 
	Johannes Weiner <hannes@...xchg.org>, linux-kernel@...r.kernel.org, Chris Mason <clm@...com>, 
	Josef Bacik <josef@...icpanda.com>, David Sterba <dsterba@...e.com>, linux-btrfs@...r.kernel.org
Subject: Re: [PATCH 2/6] btrfs: drop usage of folio_index

On Mon, Apr 28, 2025 at 8:55 AM Qu Wenruo <quwenruo.btrfs@....com> wrote:
>
>
>
> 在 2025/4/28 04:29, Kairui Song 写道:
> > From: Kairui Song <kasong@...cent.com>
> >
> > folio_index is only needed for mixed usage of page cache and swap
> > cache, for pure page cache usage, the caller can just use
> > folio->index instead.
>
> The patch looks good to me, but I'm afraid the next commit message is
> not accurate.
>
> >
> > It can't be a swap cache folio here.  Swap mapping may only call into fs
> > through `swap_rw` and that is not supported for btrfs.  So just drop it
> > and use folio->index instead.
>

Thanks for the review.

> Btrfs supports swap file, it's just not through the swap_rw() callback.

Right, I just meant btrfs is not using `swap_rw`. Of course it
supports swap files. Let me update the commit message a bit to clarify
that.

>
> In this particular case, the folio belongs to the metadata (btree)
> inode, thus it will never be swap cache folio.
>
> With that changed, it looks good to me.
>
> Reviewed-by: Qu Wenruo <wqu@...e.com>
>
> Thanks,
> Qu
>
> >
> > Signed-off-by: Kairui Song <kasong@...cent.com>
> > Cc: Chris Mason <clm@...com> (maintainer:BTRFS FILE SYSTEM)
> > Cc: Josef Bacik <josef@...icpanda.com> (maintainer:BTRFS FILE SYSTEM)
> > Cc: David Sterba <dsterba@...e.com> (maintainer:BTRFS FILE SYSTEM)
> > Cc: linux-btrfs@...r.kernel.org (open list:BTRFS FILE SYSTEM)
> > Signed-off-by: Kairui Song <kasong@...cent.com>
> > ---
> >   fs/btrfs/extent_io.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> > index 197f5e51c474..e08b50504d13 100644
> > --- a/fs/btrfs/extent_io.c
> > +++ b/fs/btrfs/extent_io.c
> > @@ -3509,7 +3509,7 @@ static void btree_clear_folio_dirty_tag(struct folio *folio)
> >       xa_lock_irq(&folio->mapping->i_pages);
> >       if (!folio_test_dirty(folio))
> >               __xa_clear_mark(&folio->mapping->i_pages,
> > -                             folio_index(folio), PAGECACHE_TAG_DIRTY);
> > +                             folio->index, PAGECACHE_TAG_DIRTY);
> >       xa_unlock_irq(&folio->mapping->i_pages);
> >   }
> >
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ