@@ -2584,26 +2584,36 @@ static void end_bio_extent_readpage(struct bio *bio)
25842584
25852585 if (tree -> ops ) {
25862586 ret = tree -> ops -> readpage_io_failed_hook (page , mirror );
2587- if (!ret && !bio -> bi_error )
2588- uptodate = 1 ;
2589- } else {
2587+ if (ret == - EAGAIN ) {
2588+ /*
2589+ * Data inode's readpage_io_failed_hook() always
2590+ * returns -EAGAIN.
2591+ *
2592+ * The generic bio_readpage_error handles errors
2593+ * the following way: If possible, new read
2594+ * requests are created and submitted and will
2595+ * end up in end_bio_extent_readpage as well (if
2596+ * we're lucky, not in the !uptodate case). In
2597+ * that case it returns 0 and we just go on with
2598+ * the next page in our bio. If it can't handle
2599+ * the error it will return -EIO and we remain
2600+ * responsible for that page.
2601+ */
2602+ ret = bio_readpage_error (bio , offset , page ,
2603+ start , end , mirror );
2604+ if (ret == 0 ) {
2605+ uptodate = !bio -> bi_error ;
2606+ offset += len ;
2607+ continue ;
2608+ }
2609+ }
2610+
25902611 /*
2591- * The generic bio_readpage_error handles errors the
2592- * following way: If possible, new read requests are
2593- * created and submitted and will end up in
2594- * end_bio_extent_readpage as well (if we're lucky, not
2595- * in the !uptodate case). In that case it returns 0 and
2596- * we just go on with the next page in our bio. If it
2597- * can't handle the error it will return -EIO and we
2598- * remain responsible for that page.
2612+ * metadata's readpage_io_failed_hook() always returns
2613+ * -EIO and fixes nothing. -EIO is also returned if
2614+ * data inode error could not be fixed.
25992615 */
2600- ret = bio_readpage_error (bio , offset , page , start , end ,
2601- mirror );
2602- if (ret == 0 ) {
2603- uptodate = !bio -> bi_error ;
2604- offset += len ;
2605- continue ;
2606- }
2616+ ASSERT (ret == - EIO );
26072617 }
26082618readpage_ok :
26092619 if (likely (uptodate )) {
0 commit comments