Firstly, excuse me, I send this mail in web site with text plain mode.
>------- Original Message -------
>> On Wed, 18 Sep 2013, Chen Gang wrote:
>
>> BUG_ON() is widely and commonly used in kernel wide, and BUG_ON() can be
>> customized by any architectures, so I guess, if google really think it
>> is necessary, it will customize it.
>>
>> If "compile-time error" will make code complex to both readers and
>> writers (e.g. our case), forcing "compile-time error" may still be good
>> enough to google, but may not be good enough for others.
>>
>
> Google has nothing to do with this, it treats BUG_ON() just like 99.99% of
> others do.
>
Please search BUG_ON() in kernel wide source code, we can know whether
it is commonly used or not.
Please search BUG in arch/ sub-system, we can know which architectures
customize BUG/BUG_ON.
After do the 2 things, In my opinion, we can treat BUG/BUG_ON() is common
implementation, and most of architectures uses the default one.
Please check again, thanks.
>> So in my opinion, for our case which is a common sub-system, not an
>> architecture specific sub-system, better use "run-time error".
>>
>
> That's absolutely insane. If code is not allocating enough memory for the
> maximum possible length of a string to be stored by mpol_to_str(), it's a
> bug in the code. We do not panic and reboot the user's machine for such a
> bug. Instead, we break the build and require the broken code to be fixed.
>
Please say in polite.
Can you be sure, the "maxlen == 50" in "fs/proc/task_mmu()", must be a bug??
I don't know whether it is, maybe you know?
> I have told you exactly how to introduce such a compile-time error.
Of cause, I already known about your opinion, and I never say what you said is
useless, that is the reason why I am still discussing with you.
All together, just in one of my original opinion, if what you said above was really
correct (may it be), the function api need "use struct (contents "char buf[64]")
pointer instead of 'buffer' and 'maxlen'."
Please send your patch for it, don't need teach others how to send patch (at
least, that will be more efficient).
Thanks.
--
Chen Gang.