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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 20 Sep 2023 17:07:20 +0900
From:   Ryusuke Konishi <konishi.ryusuke@...il.com>
To:     "Matthew Wilcox (Oracle)" <willy@...radead.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        linux-fsdevel@...r.kernel.org, gfs2@...ts.linux.dev,
        linux-nilfs@...r.kernel.org, linux-ntfs-dev@...ts.sourceforge.net,
        ntfs3@...ts.linux.dev, ocfs2-devel@...ts.linux.dev,
        reiserfs-devel@...r.kernel.org, linux-ext4@...r.kernel.org,
        Pankaj Raghav <p.raghav@...sung.com>
Subject: Re: [PATCH 13/26] nilfs2: Convert nilfs_mdt_get_frozen_buffer to use
 a folio

On Tue, Sep 19, 2023 at 6:25 PM Matthew Wilcox (Oracle) wrote:
>
> Remove a number of folio->page->folio conversions.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
> ---
>  fs/nilfs2/mdt.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c
> index 11b7cf4acc92..7b754e6494d7 100644
> --- a/fs/nilfs2/mdt.c
> +++ b/fs/nilfs2/mdt.c
> @@ -592,17 +592,19 @@ nilfs_mdt_get_frozen_buffer(struct inode *inode, struct buffer_head *bh)
>  {
>         struct nilfs_shadow_map *shadow = NILFS_MDT(inode)->mi_shadow;
>         struct buffer_head *bh_frozen = NULL;
> -       struct page *page;
> +       struct folio *folio;
>         int n;
>
> -       page = find_lock_page(shadow->inode->i_mapping, bh->b_folio->index);
> -       if (page) {
> -               if (page_has_buffers(page)) {
> +       folio = filemap_lock_folio(shadow->inode->i_mapping,
> +                       bh->b_folio->index);
> +       if (!IS_ERR(folio)) {
> +               bh_frozen = folio_buffers(folio);
> +               if (bh_frozen) {
>                         n = bh_offset(bh) >> inode->i_blkbits;
> -                       bh_frozen = nilfs_page_get_nth_block(page, n);
> +                       bh_frozen = get_nth_bh(bh_frozen, n);
>                 }
> -               unlock_page(page);
> -               put_page(page);
> +               folio_unlock(folio);
> +               folio_put(folio);
>         }
>         return bh_frozen;
>  }
> --
> 2.40.1
>

Acked-by: Ryusuke Konishi <konishi.ryusuke@...il.com>

Looks good to me.

Thanks,
Ryusuke Konishi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ