From dec83d661bf118d12013436a510ede0b8599796f Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Tue, 14 Dec 2010 00:37:39 -0700 Subject: [PATCH] b=23821 Limit bio_alloc() to BIO_MAX_PAGES iovecs. Fix logic error when patch was originally landed from b=9945. i=alex.zhuravlev i=kwestneat --- lustre/obdfilter/filter_io_26.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/obdfilter/filter_io_26.c b/lustre/obdfilter/filter_io_26.c index bc037a1..806734b 100644 --- a/lustre/obdfilter/filter_io_26.c +++ b/lustre/obdfilter/filter_io_26.c @@ -398,7 +398,7 @@ int filter_do_bio(struct obd_export *exp, struct inode *inode, } /* allocate new bio, limited by max BIO size, b=9945 */ - bio = bio_alloc(GFP_NOIO, max(BIO_MAX_PAGES, + bio = bio_alloc(GFP_NOIO, min(BIO_MAX_PAGES, (npages - page_idx) * blocks_per_page)); if (bio == NULL) { -- 1.8.3.1