From: adilger Date: Wed, 22 Oct 2008 20:22:58 +0000 (+0000) Subject: Branch HEAD X-Git-Tag: v1_9_90~19 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b4acb0af8dee2b3f037706894276906dfe792ebf;p=fs%2Flustre-release.git Branch HEAD Limit bio_alloc() size to the maximum possible value, or it will always fail. b=9945 i=johann --- diff --git a/lustre/obdfilter/filter_io_26.c b/lustre/obdfilter/filter_io_26.c index c37c585..58f6bde 100644 --- a/lustre/obdfilter/filter_io_26.c +++ b/lustre/obdfilter/filter_io_26.c @@ -371,9 +371,10 @@ int filter_do_bio(struct obd_export *exp, struct inode *inode, frags++; } - /* allocate new bio */ - bio = bio_alloc(GFP_NOIO, - (npages - page_idx) * blocks_per_page); + /* allocate new bio, limited by max BIO size, b=9945 */ + bio = bio_alloc(GFP_NOIO, max(BIO_MAX_PAGES, + (npages - page_idx) * + blocks_per_page)); if (bio == NULL) { CERROR("Can't allocate bio %u*%u = %u pages\n", (npages - page_idx), blocks_per_page,