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: <CAMuHMdUFn1aWxdgb__NY4yr1E8k_zSaaDzmkUBfyDV1mWawTMA@mail.gmail.com>
Date: Tue, 12 Aug 2025 09:24:24 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: alexjlzheng@...il.com
Cc: brauner@...nel.org, djwong@...nel.org, linux-xfs@...r.kernel.org, 
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Jinliang Zheng <alexjlzheng@...cent.com>
Subject: Re: [PATCH v2 1/4] iomap: make sure iomap_adjust_read_range() are
 aligned with block_size

Hi Jinliang,

On Mon, 11 Aug 2025 at 18:49, <alexjlzheng@...il.com> wrote:
> From: Jinliang Zheng <alexjlzheng@...cent.com>
>
> iomap_folio_state marks the uptodate state in units of block_size, so
> it is better to check that pos and length are aligned with block_size.
>
> Signed-off-by: Jinliang Zheng <alexjlzheng@...cent.com>

Thanks for your patch!

> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -234,6 +234,9 @@ static void iomap_adjust_read_range(struct inode *inode, struct folio *folio,
>         unsigned first = poff >> block_bits;
>         unsigned last = (poff + plen - 1) >> block_bits;
>
> +       BUG_ON(*pos & (block_size - 1));
> +       BUG_ON(length & (block_size - 1));

!IS_ALIGNED(...)

> +
>         /*
>          * If the block size is smaller than the page size, we need to check the
>          * per-block uptodate status and adjust the offset and length if needed

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ