mbox series

[v3,0/2] btrfs: small cleanups to buffered write path

Message ID cover.1727824586.git.wqu@suse.com (mailing list archive)
Headers show
Series btrfs: small cleanups to buffered write path | expand

Message

Qu Wenruo Oct. 1, 2024, 11:17 p.m. UTC
[CHANGELOG]
v3:
- Remove the read: tag of the second patch
  By merging the alignment and force_uptodate checks into one check.

v2:
- Utilize folio APIs instead of the old page APIs for the 2nd patch

These two are small cleanups to the buffered write path, inspired by the
btrfs test failure of generic/563 with 4K sector size and 64K page size.

The root cause of that failure is, btrfs can't avoid full page read when
the dirty range covers sectors, but not yet the full page.

This is only the preparation part, we can not yet switch to the skip the
full page read, or it will still lead to incorrect data.

The full fix needs extra co-operation between the subpage read and
write, until then prepare_uptodate_page() still needs to read the full
page.

Qu Wenruo (2):
  btrfs: remove the dirty_page local variable
  btrfs: simplify the page uptodate preparation for prepare_pages()

 fs/btrfs/file.c             | 84 ++++++++++++++++++-------------------
 fs/btrfs/file.h             |  2 +-
 fs/btrfs/free-space-cache.c |  2 +-
 3 files changed, 43 insertions(+), 45 deletions(-)

Comments

Johannes Thumshirn Oct. 2, 2024, 8:18 a.m. UTC | #1
Looks good to me,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>