On 4/21/2023 2:44 PM, Luis Chamberlain wrote: [..]
+ /* + * We cap this to allow a block to be at least allowed to + * be allocated using the buddy allocator. That's MAX_ORDER + * pages. So 4 MiB on x86_64.
8 MiB? since MAX_ORDER is 11.
+ */ + if (ctx->blocksize > (1 << (MAX_ORDER + PAGE_SHIFT))) + goto bad_value; > + + /* The blocksize must be a multiple of the page size so must be aligned */ + if (!PAGE_ALIGNED(ctx->blocksize)) + goto bad_value; + break; } return 0;
-jane