lkml.org 
[lkml]   [2013]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -next 2/3] batman-adv: Use seq_overflow
On Wed, Dec 11, 2013 at 07:55:26AM +0000, Al Viro wrote:

> This sucker should return 0. Insufficiently large buffer will be handled
> by caller, TYVM, if you give that caller a chance to do so. Returning 1
> from ->show() is a bug in almost all cases, and definitely so in this one.
>
> Just in case somebody decides that above is worth copying: It Is Not.
> Original code is buggy, plain and simple. This one trades the older
> bug ("fail with -EINVAL whenever the buffer is too small") with just as buggy
> "silently skip an entry entirely whenever the buffer is too small".
>
> Don't Do That.

Pardon - Joe has made seq_overflow return -1 instead of true. Correction
to the above, then - s/This trades.*\./This is just as buggy./

Conclusion is still the same - Don't Do That. Returning -1 on insufficiently
large buffer is a bug, plain and simple.

And this patch series is completely misguided - it doesn't fix any bugs
*and* it provides a misleading example for everyone. See the reaction
right in this thread, proposing to spread the same bug to currently
working iterators.


\
 
 \ /
  Last update: 2013-12-11 09:21    [W:0.051 / U:3.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site