From: Andreas Dilger Date: Tue, 14 Dec 2010 07:37:39 +0000 (-0700) Subject: b=23821 Limit bio_alloc() to BIO_MAX_PAGES iovecs. X-Git-Tag: 2.0.59.0~24 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=dec83d661bf118d12013436a510ede0b8599796f 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 --- 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) {