From 59d84cf42bc4486983582fbaf0da2f425a7bf90f Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 22 Oct 2008 19:35:08 +0000 Subject: [PATCH] Branch b1_8_gate Limit the requested bio size to the maximum possible size, or it will always fail with -ENOMEM. b=9945 i=johann --- lustre/obdfilter/filter_io_26.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lustre/obdfilter/filter_io_26.c b/lustre/obdfilter/filter_io_26.c index fd768c6..1fc34bf 100644 --- a/lustre/obdfilter/filter_io_26.c +++ b/lustre/obdfilter/filter_io_26.c @@ -364,9 +364,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, -- 1.8.3.1