diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 6d905a7b87d0..88838ef22413 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4965,7 +4965,7 @@ again:
 		flush_dcache_page(page);
 	}
 	ClearPageChecked(page);
-	set_page_dirty(page);
+	btrfs_page_set_dirty(fs_info, page, block_start, block_end + 1 - block_start);
 	unlock_extent_cached(io_tree, block_start, block_end, &cached_state);
 
 	if (only_release_metadata)