From: David Dillow Date: Thu, 20 Jan 2011 22:44:22 +0000 (-0800) Subject: fs/direct-io.c: don't try to allocate more than BIO_MAX_PAGES in a bio X-Git-Tag: v2.6.37.1~61 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=044b93a01aaf6450230cd5d006585eda1fe945a8;p=pandora-kernel.git fs/direct-io.c: don't try to allocate more than BIO_MAX_PAGES in a bio commit 20d9600cb407b0b55fef6ee814b60345c6f58264 upstream. When using devices that support max_segments > BIO_MAX_PAGES (256), direct IO tries to allocate a bio with more pages than allowed, which leads to an oops in dio_bio_alloc(). Clamp the request to the supported maximum, and change dio_bio_alloc() to reflect that bio_alloc() will always return a bio when called with __GFP_WAIT and a valid number of vectors. [akpm@linux-foundation.org: remove redundant BUG_ON()] Signed-off-by: David Dillow Reviewed-by: Jeff Moyer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed