The setting innodb_flush_neighbors is broken on 64-bit platforms ever since the code was refactored in
MDEV-23399 to avoid recomputing page_id_t::fold() in buf_flush_check_neighbors(). The following fixes the problem that was repeatable when attempting to flush pages in the temporary tablespace around page number 0x200002:
The problem is that the return type of page_id_t::space() is uint32_t, and therefore on 64-bit systems the fold value would not be the nonzero value (((ulint)0xfffffffe)<<20)+0xfffffffe+0x200002 (as it could be assumed on a quick read of the code), but 0, because that is what (((uint32_t)0xfffffffe)<<20)+0xfffffffe+0x200002 evaluates to.
Furthermore, there is some indication that despite
MDEV-17380, neighbour flushing was attempted on a NVMe device (major number: 259, minor number 0).
The performance of the above patch will have to be tested.