public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/2] btrfs: fix the file offset calculation inside btrfs_decompress_buf2page()
Date: Tue, 1 Apr 2025 02:33:18 -0400	[thread overview]
Message-ID: <beff4178-200b-40cf-a7cf-afceaa1b413a@dorminy.me> (raw)
In-Reply-To: <8fb7820d18bef8f661f807b3d96be2591aee6494.1743487686.git.wqu@suse.com>



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?

  reply	other threads:[~2025-04-01  6:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01  6:12 [PATCH 0/2] btrfs: two small and safe fixes for large folios Qu Wenruo
2025-04-01  6:12 ` [PATCH 1/2] btrfs: fix the ASSERT() inside GET_SUBPAGE_BITMAP() Qu Wenruo
2025-04-01  6:12 ` [PATCH 2/2] btrfs: fix the file offset calculation inside btrfs_decompress_buf2page() Qu Wenruo
2025-04-01  6:33   ` Sweet Tea Dorminy [this message]
2025-04-01  7:13     ` Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=beff4178-200b-40cf-a7cf-afceaa1b413a@dorminy.me \
    --to=sweettea-kernel@dorminy.me \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox