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

Qu Wenruo
2025-04-01T07:13:20Z

在 2025/4/1 17:03, Sweet Tea Dorminy 写道:
>
>
> 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?
>

Oh no, this must be some local change not committed, thanks for catching it.

Thanks,
Qu