Skip to content
Commit 20d9600c authored by David Dillow's avatar David Dillow Committed by Linus Torvalds
Browse files

fs/direct-io.c: don't try to allocate more than BIO_MAX_PAGES in a bio



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: default avatarDavid Dillow <dillowda@ornl.gov>
Reviewed-by: default avatarJeff Moyer <jmoyer@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 82478fb7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment