]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: subpage: do more sanity checks on metadata page dirtying
authorQu Wenruo <wqu@suse.com>
Thu, 25 Mar 2021 07:14:39 +0000 (15:14 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Apr 2021 15:25:18 +0000 (17:25 +0200)
commit6d5ce8e3f1a6e404fb226643b7f47eee75ab8e37
tree8d5698e8962fbc62e36983adc0f1f9b73267078c
parent3441da105ebc1a49245dc0a1382fd7174980cc0a
btrfs: subpage: do more sanity checks on metadata page dirtying

For btree_set_page_dirty(), we should also check the extent buffer
sanity for subpage support.

Unlike the regular sector size case, since one page can contain multiple
extent buffers, we need to make sure there is at least one dirty extent
buffer in the page.

So this patch will iterate through the btrfs_subpage::dirty_bitmap
to get the extent buffers, and check if any dirty extent buffer in the page
range has EXTENT_BUFFER_DIRTY and proper refs.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c