@@ -193,6 +193,8 @@ iomap_read_end_io(struct bio *bio)
struct bio_vec *bvec;
struct bvec_iter_all iter_all;
+ if (bio->bi_private == (void *)7)
+ error = -EIO;
bio_for_each_segment_all(bvec, bio, iter_all)
iomap_read_page_end_io(bvec, error);
bio_put(bio);
@@ -286,6 +288,12 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
if (ctx->rac) /* same as readahead_gfp_mask */
gfp |= __GFP_NORETRY | __GFP_NOWARN;
ctx->bio = bio_alloc(gfp, min(BIO_MAX_PAGES, nr_vecs));
+ if (ctx->rac) {
+ static int error = 0;
+ ctx->bio->bi_private = (void *)(error++);
+ if (error == 10)
+ error = 0;
+ }
/*
* If the bio_alloc fails, try it again for a single page to
* avoid having to deal with partial page reads. This emulates