On Thu, 19 Sep 2013, Chen,Gang( e??a??) wrote: > PleaseA searchA BUG_ON()A inA kernelA wideA sourceA code,A weA canA knowA whether > itA isA commonlyA usedA orA not. > > PleaseA searchA BUGA inA arch/A sub-system,A weA canA knowA whichA architectures > customizeA BUG/BUG_ON. > > AfterA doA theA 2A things,A InA myA opinion,A weA canA treatA BUG/BUG_ON()A isA common > implementation,A andA mostA ofA architecturesA usesA theA defaultA one. > > PleaseA checkA again,A thanks. > BUG_ON() is used for fatal conditions where continuing could potentially be harmful. Obviously it is commonly used in a kernel. That doesn't mean we BUG_ON() when a string hasn't been defined for a mempolicy mode. mpol_to_str() is not critical. It is not a fatal condition, and nothing you say is going to convince anybody on this thread that it's a fatal condition. > >A That'sA absolutelyA insane.A A IfA codeA isA notA allocatingA enoughA memoryA forA theA > >A maximumA possibleA lengthA ofA aA stringA toA beA storedA byA mpol_to_str(),A it'sA aA > >A bugA inA theA code.A A WeA doA notA panicA andA rebootA theA user'sA machineA forA suchA aA > >A bug.A A Instead,A weA breakA theA buildA andA requireA theA brokenA codeA toA beA fixed. > >A > > PleaseA sayA inA polite. > You want a polite response when you're insisting that we declare absolute failure, BUG_ON(), stop, and reboot the kernel because a mempolicy mode isn't defined as a string in mpol_to_str()? That sounds like an impolite response to the user, so see my politeness to you as coming from the users of the systems you just crashed. This is a compile-time problem, not run-time. > CanA youA beA sure,A theA "maxlenA ==A 50"A inA "fs/proc/task_mmu()",A mustA beA aA bug?? > I asked you to figure out the longest string possible to be stored by mpol_to_str(). There's nothing mysterious about that function. It's deterministic. If you really can't figure out the value this should be, then you shouldn't be touching mpol_to_str().