Btrfs: assert page dirty bit on extent buffer pages
authorLiu Bo <bo.liu@linux.alibaba.com>
Thu, 13 Sep 2018 17:46:08 +0000 (01:46 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:30 +0000 (17:23 +0200)
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 <bo.liu@linux.alibaba.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c

index 43bf4ec891c6e2a8cca89f2347d96a7e00b84def..ce2aa692b4449e5af5f27233ed89d569d927b22d 100644 (file)
@@ -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;
 }