From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: refactor __extent_writepage_io() to do sector-by-sector submission
Date: Thu, 8 Aug 2024 01:22:36 +0200 [thread overview]
Message-ID: <20240807232236.GA29853@suse.cz> (raw)
In-Reply-To: <222e8428-4847-4b93-90a9-69b5594756d2@gmx.com>
On Thu, Aug 08, 2024 at 07:35:40AM +0930, Qu Wenruo wrote:
>
>
> 在 2024/8/8 01:57, David Sterba 写道:
> > On Wed, Aug 07, 2024 at 06:21:00PM +0930, Qu Wenruo wrote:
> [...]
> >
> >> +
> >> + block_start = extent_map_block_start(em);
> >> + disk_bytenr = extent_map_block_start(em) + extent_offset;
> >> +
> >> + ASSERT(!extent_map_is_compressed(em));
> >> + ASSERT(block_start != EXTENT_MAP_HOLE);
> >> + ASSERT(block_start != EXTENT_MAP_INLINE);
> >> +
> >> + free_extent_map(em);
> >> + em = NULL;
> >> +
> >> + btrfs_set_range_writeback(inode, filepos, filepos + sectorsize - 1);
> >> + if (!folio_test_writeback(folio)) {
> >> + btrfs_err(fs_info,
> >> + "folio %lu not writeback, cur %llu end %llu",
> >> + folio->index, filepos, filepos + sectorsize);
> >
> > This is copied from the original code but I wonder if this should be a
> > hard error or more visible as it looks like bad page state tracking.
> >
>
> I believe this can be removed completely, or converted into ASSERT().
>
> For subpage case, page writeback is set if any subpage sector has
> writeback flag set.
>
> For regular case, it's setting the whole page writeback.
>
> As long as the folio is already locked, the folio should always be
> marked writeback.
>
> So I prefer to go the ASSERT() path.
Agreed, ASSERT makes sense.
prev parent reply other threads:[~2024-08-07 23:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 8:51 [PATCH] btrfs: refactor __extent_writepage_io() to do sector-by-sector submission Qu Wenruo
2024-08-07 14:18 ` Josef Bacik
2024-08-07 22:01 ` Qu Wenruo
2024-08-07 16:27 ` David Sterba
2024-08-07 22:05 ` Qu Wenruo
2024-08-07 23:22 ` David Sterba [this message]
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=20240807232236.GA29853@suse.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.com \
--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