btrfs: don't call btrfs_page_set_checked in finish_compressed_bio_read
authorChristoph Hellwig <hch@lst.de>
Thu, 7 Jul 2022 05:33:31 +0000 (07:33 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 17:56:16 +0000 (19:56 +0200)
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 <nborisov@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c
fs/btrfs/inode.c

index 8124cd3d0b6bfb2a80937582cc68c2397f0f607f..f3df9b9b438165885edf4c63ccbce8ab2dd1d354 100644 (file)
@@ -152,29 +152,9 @@ static void finish_compressed_bio_read(struct compressed_bio *cb)
        }
 
        /* Do io completion on the original bio */
-       if (cb->status != BLK_STS_OK) {
+       if (cb->status != BLK_STS_OK)
                cb->orig_bio->bi_status = cb->status;
-               bio_endio(cb->orig_bio);
-       } else {
-               struct bio_vec *bvec;
-               struct bvec_iter_all iter_all;
-
-               /*
-                * We have verified the checksum already, set page checked so
-                * the end_io handlers know about it
-                */
-               ASSERT(!bio_flagged(cb->orig_bio, BIO_CLONED));
-               bio_for_each_segment_all(bvec, cb->orig_bio, iter_all) {
-                       u64 bvec_start = page_offset(bvec->bv_page) +
-                                        bvec->bv_offset;
-
-                       btrfs_page_set_checked(btrfs_sb(cb->inode->i_sb),
-                                       bvec->bv_page, bvec_start,
-                                       bvec->bv_len);
-               }
-
-               bio_endio(cb->orig_bio);
-       }
+       bio_endio(cb->orig_bio);
 
        /* Finally free the cb struct */
        kfree(cb->compressed_pages);
index e8021d52c846c469e23e64afae1fef4807f30240..ecc5fa3343fc5e319ac79b96e781aa8954c29427 100644 (file)
@@ -3504,11 +3504,6 @@ unsigned int btrfs_verify_data_csum(struct btrfs_bio *bbio,
        u32 pg_off;
        unsigned int result = 0;
 
-       if (btrfs_page_test_checked(fs_info, page, start, end + 1 - start)) {
-               btrfs_page_clear_checked(fs_info, page, start, end + 1 - start);
-               return 0;
-       }
-
        /*
         * This only happens for NODATASUM or compressed read.
         * Normally this should be covered by above check for compressed read