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] [day] [month] [year] [list]
Message-ID: <CAOzc2pxYSpQGEEads3qfxyJgdcDzMoEyTg01Z3D2ZaAjUSOznw@mail.gmail.com>
Date:   Thu, 17 Nov 2022 23:28:21 -0800
From:   Vishal Moola <vishal.moola@...il.com>
To:     linux-mm@...ck.org
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-ext4@...r.kernel.org, akpm@...ux-foundation.org,
        willy@...radead.org, naoya.horiguchi@....com, tytso@....edu
Subject: Re: [PATCH v2 1/4] ext4: Convert move_extent_per_page() to use folios

On Thu, Nov 17, 2022 at 6:14 PM Vishal Moola (Oracle)
<vishal.moola@...il.com> wrote:
>
> Converts move_extent_per_page() to use folios. This change removes
> 5 calls to compound_head() and is in preparation for the removal of
> the try_to_release_page() wrapper.
>
> Signed-off-by: Vishal Moola (Oracle) <vishal.moola@...il.com>
> ---
>  fs/ext4/move_extent.c | 52 ++++++++++++++++++++++++++-----------------
>  1 file changed, 31 insertions(+), 21 deletions(-)
>
> diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
> index 044e34cd835c..aa67eb240ca6 100644
> --- a/fs/ext4/move_extent.c
> +++ b/fs/ext4/move_extent.c
> @@ -253,6 +253,7 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
>  {
>         struct inode *orig_inode = file_inode(o_filp);
>         struct page *pagep[2] = {NULL, NULL};
> +       struct folio *folio[2] = {NULL, NULL};
>         handle_t *handle;
>         ext4_lblk_t orig_blk_offset, donor_blk_offset;
>         unsigned long blocksize = orig_inode->i_sb->s_blocksize;
> @@ -313,6 +314,13 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
>          * hold page's lock, if it is still the case data copy is not
>          * necessary, just swap data blocks between orig and donor.
>          */
> +       folio[0] = page_folio(pagep[0]);
> +       folio[1] = page_folio(pagep[1]);
> +
> +       VM_BUG_ON_FOLIO(!folio_test_large(folio[0]), folio[0]);
> +       VM_BUG_ON_FOLIO(!folio_test_large(folio[1]), folio[1]);
> +       VM_BUG_ON_FOLIO(folio_nr_pages(folio[0]) != folio_nr_pages(folio[1]), folio[1]);

Looks like I got my assertions backward. We want to BUG if the folios are large,
or if they are different sizes. Disregard v2, its fixed in v3.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ