Just in case that someone breaks the rule that pages are dirty as long
as eb is dirty.

Signed-off-by: Liu Bo <bo....@linux.alibaba.com>
---
v2: fix typo of CONFIG_BTRFS_DEBUG

 fs/btrfs/extent_io.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index fb2bf50134a1..f88231171009 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -5184,6 +5184,11 @@ bool set_extent_buffer_dirty(struct extent_buffer *eb)
                        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;
 }
 
-- 
1.8.3.1

Reply via email to