Re: [PATCH] crypto: hash - Make HASH_MAX_DESCSIZE a bit more obvious

From: Linus Torvalds
Date: Mon Aug 11 2025 - 03:11:17 EST


On Mon, 11 Aug 2025 at 07:44, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:
>
> The patch below should make the constant a bit more obvious.

Indeed.

It would be good to maybe minimize the on-stack max-sized allocations,
but that's a separate issue. Several hundred bytes is a noticeable
part of the stack, and it's not always clear that it's a shallow stack
with not a lot else going on..

(I just randomly picked the btrfs csum hash to look at, which can
apparently be one of crc32c / xxhash64 / sha256 or blake2b, and which
is then used at bio submission time, and I wouldn't be surprised if it
probably has a pretty deep stack at that point already).

Oh well.

Linus