Skip to content

Commit c0558ba

Browse files
adam900710kdave
authored andcommitted
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: Josef Bacik <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Naohiro Aota <[email protected]> Signed-off-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 4b8f2b0 commit c0558ba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/btrfs/extent_io.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,8 +2351,11 @@ void extent_write_locked_range(struct inode *inode, struct page *locked_page,
23512351

23522352
/* Make sure the mapping tag for page dirty gets cleared. */
23532353
if (nr == 0) {
2354-
set_page_writeback(page);
2355-
end_page_writeback(page);
2354+
struct folio *folio;
2355+
2356+
folio = page_folio(page);
2357+
btrfs_folio_set_writeback(fs_info, folio, cur, cur_len);
2358+
btrfs_folio_clear_writeback(fs_info, folio, cur, cur_len);
23562359
}
23572360
if (ret) {
23582361
btrfs_mark_ordered_io_finished(BTRFS_I(inode), page,

0 commit comments

Comments
 (0)