Re: [syzbot] [mm?] WARNING in ep_write_iter
Alan Stern <[email protected]>
| Newsgroups | org.kernel.vger.linux-usb,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Aug 17, 2026 at 02:45:19PM -0400, Zi Yan wrote: > On 17 Aug 2026, at 11:37, Alan Stern wrote: > >>> Regardless, if it is important to let kernel developers know that their > >>> code is doing something wrong, why not make the WARN conditional on > >>> CONFIG_EXPERT or something similar? In other words, prevent it from > >>> crashing production systems. > > > > You didn't respond to this. > > I do not get your argument here. Why does this WARN need to be conditional > on CONFIG_EXPERT? What makes it special? Or you mean you want all WARNs > to be conditional CONFIG_EXPERT? This may be a moot point now, but I'll answer the questions anyway. This WARN should be conditional on something indicating that the kernel is meant for testing rather than production (not necessarily CONFIG_EXPERT but something like it) because it does not indicate that an operation has failed badly enough to leave the kernel in a dangerously unstable state. Rather, it indicates that a programmer has tried to do something that can't possibly succeed. The result should not be dangerous because the caller should always check kmalloc()'s return value. If the caller is unable to recover from a memory allocation failure then it is the caller's responsibility to WARN, not kmalloc()'s. The same is true for all other WARN statements. If they merely indicate a programming infelicity and not a dangerous failure then they should not fire in production kernels. Alan Stern