[lkml]   [2010]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH 0/6] improve list_sort test
    On Sun, 2010-08-08 at 12:31 -0700, Don Mullis wrote:
    > Yes, invalid 'a' or 'b' pointers would be a bug. If providing a test
    > case is hard, can you say what segment is pointed to? Into the stack?
    > Into address ranges normal for elements, but not now on the list? Is
    > there a pattern to the values returned? Is it perhaps always the
    > first or last callback from a particular call to list_sort()?

    You've correctly identified in the the other mail that 'a' and 'b'
    sometimes point to the list head. I've just checked this.

    > That sometimes a==b is, on the other hand, by design:
    > /*
    > * In worst cases this loop may run many iterations.
    > * Continue callbacks to the client even though no
    > * element comparison is needed, so the client's cmp()
    > * routine can invoke cond_resched() periodically.
    > */
    > (*cmp)(priv, tail, tail);
    > Adding a sentence to the function header comment reminding callers
    > that they need to be able to handle a==b seems like a good idea.

    OK, I'll add it.

    Best Regards,
    Artem Bityutskiy (Артём Битюцкий)

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2010-08-21 11:37    [W:0.020 / U:5.436 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site