]> www.infradead.org Git - users/hch/misc.git/commit
btrfs: fix clear_dirty and writeback ordering in submit_one_sector()
authorNaohiro Aota <naohiro.aota@wdc.com>
Fri, 4 Oct 2024 04:53:35 +0000 (13:53 +0900)
committerDavid Sterba <dsterba@suse.com>
Wed, 9 Oct 2024 11:23:51 +0000 (13:23 +0200)
commite761be2a0744086fc4793a4870d4b5746b7fe8cd
tree627f6bf7d905fe0a0b99005eb8ff5e8ce76865be
parentfe4cd7ed128fe82ab9fe4f9fc8a73d4467699787
btrfs: fix clear_dirty and writeback ordering in submit_one_sector()

This commit is a replay of commit 6252690f7e1b ("btrfs: fix invalid
mapping of extent xarray state"). We need to call
btrfs_folio_clear_dirty() before btrfs_set_range_writeback(), so that
xarray DIRTY tag is cleared.

With a refactoring commit 8189197425e7 ("btrfs: refactor
__extent_writepage_io() to do sector-by-sector submission"), it screwed
up and the order is reversed and causing the same hang. Fix the ordering
now in submit_one_sector().

Fixes: 8189197425e7 ("btrfs: refactor __extent_writepage_io() to do sector-by-sector submission")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c