Skip to content

Commit 0b078d9

Browse files
Christoph Hellwigkdave
authored andcommitted
btrfs: don't call btrfs_page_set_checked in finish_compressed_bio_read
This flag was used to communicate that the low-level compression code already did verify the checksum to the high-level I/O completion code. But it has been unused for a long time as the upper btrfs_bio for the decompressed data had a NULL csum pointer basically since that pointer existed and the code already checks for that a little later. Note that this does not affect the other use of the checked flag, which is only used for the COW fixup worker. Reviewed-by: Nikolay Borisov <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 81bd932 commit 0b078d9

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

fs/btrfs/compression.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -152,29 +152,9 @@ static void finish_compressed_bio_read(struct compressed_bio *cb)
152152
}
153153

154154
/* Do io completion on the original bio */
155-
if (cb->status != BLK_STS_OK) {
155+
if (cb->status != BLK_STS_OK)
156156
cb->orig_bio->bi_status = cb->status;
157-
bio_endio(cb->orig_bio);
158-
} else {
159-
struct bio_vec *bvec;
160-
struct bvec_iter_all iter_all;
161-
162-
/*
163-
* We have verified the checksum already, set page checked so
164-
* the end_io handlers know about it
165-
*/
166-
ASSERT(!bio_flagged(cb->orig_bio, BIO_CLONED));
167-
bio_for_each_segment_all(bvec, cb->orig_bio, iter_all) {
168-
u64 bvec_start = page_offset(bvec->bv_page) +
169-
bvec->bv_offset;
170-
171-
btrfs_page_set_checked(btrfs_sb(cb->inode->i_sb),
172-
bvec->bv_page, bvec_start,
173-
bvec->bv_len);
174-
}
175-
176-
bio_endio(cb->orig_bio);
177-
}
157+
bio_endio(cb->orig_bio);
178158

179159
/* Finally free the cb struct */
180160
kfree(cb->compressed_pages);

fs/btrfs/inode.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3504,11 +3504,6 @@ unsigned int btrfs_verify_data_csum(struct btrfs_bio *bbio,
35043504
u32 pg_off;
35053505
unsigned int result = 0;
35063506

3507-
if (btrfs_page_test_checked(fs_info, page, start, end + 1 - start)) {
3508-
btrfs_page_clear_checked(fs_info, page, start, end + 1 - start);
3509-
return 0;
3510-
}
3511-
35123507
/*
35133508
* This only happens for NODATASUM or compressed read.
35143509
* Normally this should be covered by above check for compressed read

0 commit comments

Comments
 (0)