Re: [patch] aio: Don't zero out the pages array inside struct dio

From: Jeff Moyer
Date: Fri Oct 30 2009 - 17:22:42 EST


Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> writes:

> You forgot something:
>
> --- a/fs/direct-io.c~aio-dont-zero-out-the-pages-array-inside-struct-dio-fix
> +++ a/fs/direct-io.c
> @@ -130,6 +130,12 @@ struct dio {
> unsigned head; /* next page to process */
> unsigned tail; /* last valid page + 1 */
> int page_errors; /* errno from get_user_pages() */
> +
> + /*
> + * pages[] (and any fields placed after it) are not zeroed out at
> + * allocation time. Don't add new fields after pages[] unless you
> + * wish that they not be zeroed.
> + */
> struct page *pages[DIO_PAGES]; /* page buffer */
> };
>

Yeah, that makes sense. Thanks for adding it, Andrew. Oh, and it looks
like I botched the subject line. It should have read dio, not aio, but
I'm not sure that matters a whole lot.

Cheers,
Jeff
--
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/