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]
Message-ID: <CAHk-=wjxYL9=5MCLhYe8xjeqow7X5dga+_HW96Oh5UufqEsuQg@mail.gmail.com>
Date: Mon, 20 Jan 2025 11:39:49 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Christian Brauner <brauner@...nel.org>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [GIT PULL] vfs dio

On Mon, 20 Jan 2025 at 11:24, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> And that field was added in a way that causes the struct to grow due
> to alignment issues.  For no good reason, because there were existing
> holes in there.
>
> So please just fix it.

Side note: for extra bonus points, just make those fields be 'u8' or
even smaller, knowing that the values

 (a) have to be powers of two anyway because nobody can deal with anything else

 (b) the powers are already limited to 31 on the top end (by the
existing use of 'u32') and 9 on the low end (by SECTOR_SIZE)

And yeah, maybe somebody wants to have a "no alignment possible"
value, so that would make it a total of 24 different values.

You really don't need 32 bits to encode 24 values.

So wasting three 32-bit words for this all - and an extra one for the
bad alignment - is just a crime, and only makes kstat bigger on stack.

It also just adds extra code, since most *sources* have the size in
bits anyway: it typically comes from things i_blocksize(), which just
does

        return (1 << node->i_blkbits);

and it would be better to just give the bit number.

(XFS uses a special XFS_FSB_TO_B() thing to turn its bit-numbers to
byte sizes - I'm not claiming that everybody uses i_blkbits, I'm just
claiming that all sane users already are in terms of bits)

               Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ