Whamcloud - gitweb
b=23821 Limit bio_alloc() to BIO_MAX_PAGES iovecs.
authorAndreas Dilger <andreas.dilger@oracle.com>
Tue, 14 Dec 2010 07:37:39 +0000 (00:37 -0700)
committerVitaly Fertman <vitaly.fertman@oracle.com>
Wed, 15 Dec 2010 02:25:01 +0000 (05:25 +0300)
Fix logic error when patch was originally landed from b=9945.

i=alex.zhuravlev
i=kwestneat

lustre/obdfilter/filter_io_26.c

index bc037a1..806734b 100644 (file)
@@ -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) {