From: Liu Bo Date: Thu, 13 Sep 2018 17:46:08 +0000 (+0800) Subject: Btrfs: assert page dirty bit on extent buffer pages X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=51995c399b73dacb9d84375ad5a8fda3aced03ab;p=openwrt%2Fstaging%2Fblogic.git Btrfs: assert page dirty bit on extent buffer pages Just in case that someone breaks the rule that pages are dirty as long as eb is dirty. The next patch will dirty the pages conditionally. Signed-off-by: Liu Bo Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 43bf4ec891c6..ce2aa692b444 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -5176,6 +5176,12 @@ int set_extent_buffer_dirty(struct extent_buffer *eb) for (i = 0; i < num_pages; i++) set_page_dirty(eb->pages[i]); + +#ifdef CONFIG_BTRFS_DEBUG + for (i = 0; i < num_pages; i++) + ASSERT(PageDirty(eb->pages[i])); +#endif + return was_dirty; }