Re: [PATCH v2 1/2] mm: fix mmap errno value when MAP_DROPPABLE is not supported

From: Pedro Falcato

Date: Mon Apr 06 2026 - 04:35:53 EST


On Thu, Apr 02, 2026 at 04:59:32PM -0700, Anthony Yznaga wrote:
> On configs where MAP_DROPPABLE is not supported (currently any 32-bit
> config except for PPC32), mmap fails with errno set to ENOTSUPP.
> However, ENOTSUPP is not a standard error value that userspace knows
> about. The acceptable userspace-visible errno to use is EOPNOTSUPP.
> checkpatch.pl has a warning to this effect.
>
> Fixes: 9651fcedf7b9 ("mm: add MAP_DROPPABLE for designating always lazily freeable mappings")
> Cc: <stable@xxxxxxxxxxxxxxx>
> Signed-off-by: Anthony Yznaga <anthony.yznaga@xxxxxxxxxx>

FWIW I'm not a huge fan of EOPNOTSUPP here, because there's no precedent for
EOPNOTSUPP (it would perhaps normally be EINVAL, but the kernel does recognize
the flag, it just can't implement it...)

Anyway,

Reviewed-by: Pedro Falcato <pfalcato@xxxxxxx>

--
Pedro