Re: /proc/sys/kernel/pid_max issues

From: Ingo Molnar
Date: Sun Sep 12 2004 - 04:56:32 EST



* William Lee Irwin III <wli@xxxxxxxxxxxxxx> wrote:

> + if (map > &pidmap_array[pid_max/BITS_PER_PAGE])
> + map = pidmap_array;

> - if (offset >= BITS_PER_PAGE)
> + pid = (map - pidmap_array) * BITS_PER_PAGE + offset;
> + if (offset >= BITS_PER_PAGE || pid >= pid_max)
> goto next_map;
> if (test_and_set_bit(offset, map->page))
> goto scan_more;
> -
> /* we got the PID: */
> - pid = (map - pidmap_array) * BITS_PER_PAGE + offset;
> goto return_pid;

i missed the wrapping, so your patch is the right one:

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/