Skip to content

Commit 7ad635e

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
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) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 1f56eed commit 7ad635e

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

fs/buffer.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate)
258258
} else {
259259
clear_buffer_uptodate(bh);
260260
buffer_io_error(bh, ", async page read");
261-
folio_set_error(folio);
262261
}
263262

264263
/*
@@ -391,7 +390,6 @@ static void end_buffer_async_write(struct buffer_head *bh, int uptodate)
391390
buffer_io_error(bh, ", lost async page write");
392391
mark_buffer_write_io_error(bh);
393392
clear_buffer_uptodate(bh);
394-
folio_set_error(folio);
395393
}
396394

397395
first = folio_buffers(folio);
@@ -1960,7 +1958,6 @@ int __block_write_full_folio(struct inode *inode, struct folio *folio,
19601958
clear_buffer_dirty(bh);
19611959
}
19621960
} while ((bh = bh->b_this_page) != head);
1963-
folio_set_error(folio);
19641961
BUG_ON(folio_test_writeback(folio));
19651962
mapping_set_error(folio->mapping, err);
19661963
folio_start_writeback(folio);
@@ -2405,10 +2402,8 @@ int block_read_full_folio(struct folio *folio, get_block_t *get_block)
24052402
if (iblock < lblock) {
24062403
WARN_ON(bh->b_size != blocksize);
24072404
err = get_block(inode, iblock, bh, 0);
2408-
if (err) {
2409-
folio_set_error(folio);
2405+
if (err)
24102406
page_error = true;
2411-
}
24122407
}
24132408
if (!buffer_mapped(bh)) {
24142409
folio_zero_range(folio, i * blocksize,

fs/mpage.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,8 @@ static void mpage_read_end_io(struct bio *bio)
4848
struct folio_iter fi;
4949
int err = blk_status_to_errno(bio->bi_status);
5050

51-
bio_for_each_folio_all(fi, bio) {
52-
if (err)
53-
folio_set_error(fi.folio);
54-
else
55-
folio_mark_uptodate(fi.folio);
56-
folio_unlock(fi.folio);
57-
}
51+
bio_for_each_folio_all(fi, bio)
52+
folio_end_read(fi.folio, err == 0);
5853

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

6762
bio_for_each_folio_all(fi, bio) {
68-
if (err) {
69-
folio_set_error(fi.folio);
63+
if (err)
7064
mapping_set_error(fi.folio->mapping, err);
71-
}
7265
folio_end_writeback(fi.folio);
7366
}
7467

0 commit comments

Comments
 (0)