Commit a185373e authored by Qu Wenruo's avatar Qu Wenruo Committed by David Sterba

btrfs: make extent_write_locked_range() handle subpage writeback correctly

When extent_write_locked_range() generated an inline extent, it would
set and finish the writeback for the whole page.

Although currently it's safe since subpage disables inline creation,
for the sake of consistency, let it go with subpage helpers to set and
clear the writeback flags.
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarNaohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 97713b1a
...@@ -2351,8 +2351,11 @@ void extent_write_locked_range(struct inode *inode, struct page *locked_page, ...@@ -2351,8 +2351,11 @@ void extent_write_locked_range(struct inode *inode, struct page *locked_page,
/* Make sure the mapping tag for page dirty gets cleared. */ /* Make sure the mapping tag for page dirty gets cleared. */
if (nr == 0) { if (nr == 0) {
set_page_writeback(page); struct folio *folio;
end_page_writeback(page);
folio = page_folio(page);
btrfs_folio_set_writeback(fs_info, folio, cur, cur_len);
btrfs_folio_clear_writeback(fs_info, folio, cur, cur_len);
} }
if (ret) { if (ret) {
btrfs_mark_ordered_io_finished(BTRFS_I(inode), page, btrfs_mark_ordered_io_finished(BTRFS_I(inode), page,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment