Skip to content

Commit

Permalink
buffer: Remove calls to set and clear the folio error flag
Browse files Browse the repository at this point in the history
The folio error flag is not tested anywhere, so we can stop setting
and clearing it.

Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Christian Brauner <[email protected]>
  • Loading branch information
Matthew Wilcox (Oracle) authored and brauner committed May 31, 2024
1 parent 1f56eed commit 7ad635e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
7 changes: 1 addition & 6 deletions fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate)
} else {
clear_buffer_uptodate(bh);
buffer_io_error(bh, ", async page read");
folio_set_error(folio);
}

/*
Expand Down Expand Up @@ -391,7 +390,6 @@ static void end_buffer_async_write(struct buffer_head *bh, int uptodate)
buffer_io_error(bh, ", lost async page write");
mark_buffer_write_io_error(bh);
clear_buffer_uptodate(bh);
folio_set_error(folio);
}

first = folio_buffers(folio);
Expand Down Expand Up @@ -1960,7 +1958,6 @@ int __block_write_full_folio(struct inode *inode, struct folio *folio,
clear_buffer_dirty(bh);
}
} while ((bh = bh->b_this_page) != head);
folio_set_error(folio);
BUG_ON(folio_test_writeback(folio));
mapping_set_error(folio->mapping, err);
folio_start_writeback(folio);
Expand Down Expand Up @@ -2405,10 +2402,8 @@ int block_read_full_folio(struct folio *folio, get_block_t *get_block)
if (iblock < lblock) {
WARN_ON(bh->b_size != blocksize);
err = get_block(inode, iblock, bh, 0);
if (err) {
folio_set_error(folio);
if (err)
page_error = true;
}
}
if (!buffer_mapped(bh)) {
folio_zero_range(folio, i * blocksize,
Expand Down
13 changes: 3 additions & 10 deletions fs/mpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,8 @@ static void mpage_read_end_io(struct bio *bio)
struct folio_iter fi;
int err = blk_status_to_errno(bio->bi_status);

bio_for_each_folio_all(fi, bio) {
if (err)
folio_set_error(fi.folio);
else
folio_mark_uptodate(fi.folio);
folio_unlock(fi.folio);
}
bio_for_each_folio_all(fi, bio)
folio_end_read(fi.folio, err == 0);

bio_put(bio);
}
Expand All @@ -65,10 +60,8 @@ static void mpage_write_end_io(struct bio *bio)
int err = blk_status_to_errno(bio->bi_status);

bio_for_each_folio_all(fi, bio) {
if (err) {
folio_set_error(fi.folio);
if (err)
mapping_set_error(fi.folio->mapping, err);
}
folio_end_writeback(fi.folio);
}

Expand Down

0 comments on commit 7ad635e

Please sign in to comment.