On Thu, 10 May 2018 08:46:18 +0900 Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> wrote: > > page-allocation-fauilure warning and a nice backtrace, etc. Why > > suppress all of that and add our custom warning instead? > > the intent of this patch is to avoid panic() by panic_on_warn == 1 > due to hitting > > struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags) > { > unsigned int index; > > if (unlikely(size > KMALLOC_MAX_SIZE)) { > WARN_ON_ONCE(!(flags & __GFP_NOWARN)); /* <= this line */ > return NULL; > } > > when size to allocate is controlled by the filesystem image. Well, the same could happen with many many memory-allocation sites. What's special about BFS? If someone sets panic_on_warn=1 then presumably this panic is the behaviour they wanted in this case.