From: Jens Axboe Date: Tue, 23 Oct 2007 18:35:58 +0000 (+0200) Subject: [SG] Add debug check for page alignment X-Git-Tag: v2.6.24-rc1~26 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de26103de56a0c482ad21296eae9b06deefc8e62;p=linux-2.6 [SG] Add debug check for page alignment Suggested by Boaz Harrosh Signed-off-by: Jens Axboe --- diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 42daf5e152..df7ddcee7c 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h @@ -41,6 +41,11 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page) { unsigned long page_link = sg->page_link & 0x3; + /* + * In order for the low bit stealing approach to work, pages + * must be aligned at a 32-bit boundary as a minimum. + */ + BUG_ON((unsigned long) page & 0x03); #ifdef CONFIG_DEBUG_SG BUG_ON(sg->sg_magic != SG_MAGIC); #endif