From: Andreas Dilger Date: Thu, 23 Sep 2010 19:17:19 +0000 (-0600) Subject: b=23821 Limit bio_alloc() to BIO_MAX_PAGES iovecs. X-Git-Tag: 1.8.5.51~7 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=fa5e7ebfd8a2f7a9ef1c33c0d7b2fd358c716d9e;p=fs%2Flustre-release.git 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 c24a45b..bd2cee4 100644 --- a/lustre/obdfilter/filter_io_26.c +++ b/lustre/obdfilter/filter_io_26.c @@ -397,7 +397,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) {