btrfs: fix the uptodate assert in btree_csum_one_bio
PATCH 1/1 btrfs: fix the uptodate assert in btree_csum_one_bio
btree_csum_one_bio needs to use the btrfs_page_test_uptodate helper to check for uptodate status as the page might not be marked uptodate for a sub-page size buffer.
Fixes 5067444c99c3 ("btrfs: remove the extent_buffer lookup in btree block checksumming")
Reported-by Qu Wenruo <[email protected]>
Signed-off-by Christoph Hellwig <[email protected]>
Tested-by Qu Wenruo <[email protected]>
--- fs/btrfs/disk-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/btrfs/disk-io.c +2 -1
@@ -269,7 +269,8 @@ blk_status_t btree_csum_one_bio(struct btrfs_bio *bbio)if (WARN_ON_ONCE (found_start != eb->start))return BLK_STS_IOERR ; -if (WARN_ON_ONCE (!PageUptodate (eb->pages[0 ]))) +if (WARN_ON (!btrfs_page_test_uptodate (fs_info, eb->pages[0 ], + eb->start, eb->len)))return BLK_STS_IOERR ; ASSERT(memcmp_extent_buffer(eb, fs_info->fs_devices->metadata_uuid,
Signature · 1 line
2.39.2
Quoted 8 lines · Christoph Hellwig
btree_csum_one_bioneeds to use thebtrfs_page_test_uptodatehelper to check for uptodate status as the page might not be marked uptodate for a sub-page size buffer.Fixes 5067444c99c3 ("btrfs: remove the extent_buffer lookup in btree block checksumming")Reported-by Qu Wenruo <[email protected]>Signed-off-by Christoph Hellwig <[email protected]>Tested-by Qu Wenruo <[email protected]>
Reviewed-by Qu Wenruo <[email protected]>
Thanks,
Qu
Quoted 18 lines
--- fs/btrfs/disk-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)fs/btrfs/disk-io.c +2
-1@@ -269,7 +269,8 @@ blk_status_t btree_csum_one_bio(struct btrfs_bio *bbio)if (WARN_ON_ONCE (found_start != eb->start))return BLK_STS_IOERR ; -if (WARN_ON_ONCE (!PageUptodate (eb->pages[0 ]))) +if (WARN_ON (!btrfs_page_test_uptodate (fs_info, eb->pages[0 ], + eb->start, eb->len)))return BLK_STS_IOERR ; ASSERT(memcmp_extent_buffer(eb, fs_info->fs_devices->metadata_uuid,
Quoted 5 lines · Christoph Hellwig
btree_csum_one_bioneeds to use thebtrfs_page_test_uptodatehelper to check for uptodate status as the page might not be marked uptodate for a sub-page size buffer.Fixes 5067444c99c3 ("btrfs: remove the extent_buffer lookup in btree block checksumming")
Folded to the patch, thanks.
Quoted 3 lines
Reported-by Qu Wenruo <[email protected]>Signed-off-by Christoph Hellwig <[email protected]>Tested-by Qu Wenruo <[email protected]>