Re: [PATCH 2/2] btrfs: fix the file offset calculation inside btrfs_decompress_buf2page()

Sweet Tea Dorminy
2025-04-01T06:33:19Z

On 4/1/25 2:12 AM, Qu Wenruo wrote:
> +static u64 file_offset_from_bvec(const struct bio_vec *bvec)
> +{
> + const struct page *page = bvec->bv_page;
> + const struct folio *folio = page_folio(page);
> +
> + return page_pgoff(folio, page) + bvec->bv_offset;
> +}

I think this needs to be page_pgoff() << PAGE_SHIFT + bvec->bv_offset:
page_pgoff() returns in units of PAGE_SIZE, while bv_offset is in bytes?