ext4: do not iput inode under running transaction in ext4_rename()
[sfrench/cifs-2.6.git] / fs / ext4 / readpage.c
index f014c5e473a9d228d7c3e66ef0214768725a0540..3db9234035053ed976030abc2152acf9c3aac84a 100644 (file)
@@ -371,8 +371,7 @@ int ext4_mpage_readpages(struct inode *inode,
                         * bio_alloc will _always_ be able to allocate a bio if
                         * __GFP_DIRECT_RECLAIM is set, see bio_alloc_bioset().
                         */
-                       bio = bio_alloc(GFP_KERNEL,
-                               min_t(int, nr_pages, BIO_MAX_PAGES));
+                       bio = bio_alloc(GFP_KERNEL, bio_max_segs(nr_pages));
                        fscrypt_set_bio_crypt_ctx(bio, inode, next_block,
                                                  GFP_KERNEL);
                        ext4_set_bio_post_read_ctx(bio, inode, page->index);