1

buffer: Remove calls to set and clear the folio error flag

The folio error flag is not tested anywhere, so we can stop setting
and clearing it.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://lore.kernel.org/r/20240530202110.2653630-17-willy@infradead.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Matthew Wilcox (Oracle) 2024-05-30 21:21:08 +01:00 committed by Christian Brauner
parent 1f56eedf7f
commit 7ad635ea82
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2
2 changed files with 4 additions and 16 deletions

View File

@ -258,7 +258,6 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate)
} else { } else {
clear_buffer_uptodate(bh); clear_buffer_uptodate(bh);
buffer_io_error(bh, ", async page read"); buffer_io_error(bh, ", async page read");
folio_set_error(folio);
} }
/* /*
@ -391,7 +390,6 @@ static void end_buffer_async_write(struct buffer_head *bh, int uptodate)
buffer_io_error(bh, ", lost async page write"); buffer_io_error(bh, ", lost async page write");
mark_buffer_write_io_error(bh); mark_buffer_write_io_error(bh);
clear_buffer_uptodate(bh); clear_buffer_uptodate(bh);
folio_set_error(folio);
} }
first = folio_buffers(folio); first = folio_buffers(folio);
@ -1960,7 +1958,6 @@ recover:
clear_buffer_dirty(bh); clear_buffer_dirty(bh);
} }
} while ((bh = bh->b_this_page) != head); } while ((bh = bh->b_this_page) != head);
folio_set_error(folio);
BUG_ON(folio_test_writeback(folio)); BUG_ON(folio_test_writeback(folio));
mapping_set_error(folio->mapping, err); mapping_set_error(folio->mapping, err);
folio_start_writeback(folio); folio_start_writeback(folio);
@ -2405,11 +2402,9 @@ int block_read_full_folio(struct folio *folio, get_block_t *get_block)
if (iblock < lblock) { if (iblock < lblock) {
WARN_ON(bh->b_size != blocksize); WARN_ON(bh->b_size != blocksize);
err = get_block(inode, iblock, bh, 0); err = get_block(inode, iblock, bh, 0);
if (err) { if (err)
folio_set_error(folio);
page_error = true; page_error = true;
} }
}
if (!buffer_mapped(bh)) { if (!buffer_mapped(bh)) {
folio_zero_range(folio, i * blocksize, folio_zero_range(folio, i * blocksize,
blocksize); blocksize);

View File

@ -48,13 +48,8 @@ static void mpage_read_end_io(struct bio *bio)
struct folio_iter fi; struct folio_iter fi;
int err = blk_status_to_errno(bio->bi_status); int err = blk_status_to_errno(bio->bi_status);
bio_for_each_folio_all(fi, bio) { bio_for_each_folio_all(fi, bio)
if (err) folio_end_read(fi.folio, err == 0);
folio_set_error(fi.folio);
else
folio_mark_uptodate(fi.folio);
folio_unlock(fi.folio);
}
bio_put(bio); bio_put(bio);
} }
@ -65,10 +60,8 @@ static void mpage_write_end_io(struct bio *bio)
int err = blk_status_to_errno(bio->bi_status); int err = blk_status_to_errno(bio->bi_status);
bio_for_each_folio_all(fi, bio) { bio_for_each_folio_all(fi, bio) {
if (err) { if (err)
folio_set_error(fi.folio);
mapping_set_error(fi.folio->mapping, err); mapping_set_error(fi.folio->mapping, err);
}
folio_end_writeback(fi.folio); folio_end_writeback(fi.folio);
} }