On Thu, Jun 14, 2018 at 3:05 PM, Tigran Aivazian <aivazian.tigran@xxxxxxxxx> wrote: > On 14 June 2018 at 13:38, Dmitry Vyukov <dvyukov@xxxxxxxxxx> wrote: >> Consider, currently we can have a bfs image that works fine on one >> kernel, but fails to mount on another just because it happens so that >> one could allocate 4MB with kmalloc, but another can't (different >> allocator/different settings/different kernel revision). > > Yes, but this would only happen _without_ the validation proposed by > Tetsuo Handa. If we check s_start then the invalid enormous allocation > request will not be made and what you describe won't not happen. Agree. If we do a sanity check first, then __GFP_NOWARN is actually useful: it will detect the cases where a filesystem can be mounted on one machine but not on another (and will also double check that our sanity is really sane).