Btrfs: assert page dirty bit
PATCH 1/1 Btrfs: assert page dirty bit
Just in case that someone breaks the rule that pages are dirty as long as eb is dirty.
--- fs/btrfs/extent_io.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/btrfs/extent_io.c +5 -0
@@ -5184,6 +5184,11 @@ bool set_extent_buffer_dirty(struct extent_buffer *eb)set_page_dirty (eb->pages[i]); } +#ifdef BTRFS_DEBUG +for (i =0 ; i < num_pages; i++) +ASSERT (PageDirty (eb->pages[i])); +#endif +return was_dirty; }
Signature · 1 line
1.8.3.1
Quoted 13 lines · Liu Bo
Just in case that someone breaks the rule that pages are dirty as long as eb is dirty.
Signed-off-by Liu Bo <[email protected]>--- fs/btrfs/extent_io.c | 5 +++++ 1 file changed, 5 insertions(+)fs/btrfs/extent_io.c +0
-0
fs/btrfs/extent_io.c bool set_extent_buffer_dirty(struct extent_buffer *eb) · line 5187
Quoted 4 lines
fs/btrfs/extent_io.c +1
-0@@ -5184,6 +5184,11 @@ bool set_extent_buffer_dirty(struct extent_buffer *eb)set_page_dirty (eb->pages[i]); } +#ifdef BTRFS_DEBUG
And this will never be compiled since the actual ifdef name is "CONFIG_BTRFS_DEBUG"
Quoted 8 lines
fs/btrfs/extent_io.c +4
-0+for (i =0 ; i < num_pages; i++) +ASSERT (PageDirty (eb->pages[i])); +#endif +return was_dirty; }
Quoted 19 lines · Nikolay Borisov
Quoted 16 lines · Liu Bo
Just in case that someone breaks the rule that pages are dirty as long as eb is dirty.
Signed-off-by Liu Bo <[email protected]>--- fs/btrfs/extent_io.c | 5 +++++ 1 file changed, 5 insertions(+)fs/btrfs/extent_io.c +0
-0@@ -5184,6 +5184,11 @@ bool set_extent_buffer_dirty(struct extent_buffer *eb)set_page_dirty (eb->pages[i]); }
Quoted 5 lines
fs/btrfs/extent_io.c bool set_extent_buffer_dirty(struct extent_buffer *eb) · line 5187
Quoted 1 line
fs/btrfs/extent_io.c +1
-0+#ifdef BTRFS_DEBUG And this will never be compiled since the actual ifdef name is "
CONFIG_BTRFS_DEBUG"
Oops, will fix it.
thanks,
-liubo
Quoted 8 lines
Quoted 8 lines
fs/btrfs/extent_io.c +4
-0+for (i =0 ; i < num_pages; i++) +ASSERT (PageDirty (eb->pages[i])); +#endif +return was_dirty; }
PATCH v2 1/1 Btrfs: assert page dirty bit
In reply to Liu BoJust in case that someone breaks the rule that pages are dirty as long as eb is dirty.
---
v2: fix typo of CONFIG_BTRFS_DEBUG
fs/btrfs/extent_io.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/btrfs/extent_io.c +5 -0
@@ -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; }
Signature · 1 line
1.8.3.1
Quoted 4 lines · Liu Bo
Just in case that someone breaks the rule that pages are dirty as long as eb is dirty.
Signed-off-by Liu Bo <[email protected]>
Quoted 23 lines
---
v2: fix typo ofCONFIG_BTRFS_DEBUGfs/btrfs/extent_io.c | 5 +++++ 1 file changed, 5 insertions(+)fs/btrfs/extent_io.c +5
-0@@ -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; }
Quoted 4 lines · Liu Bo
Just in case that someone breaks the rule that pages are dirty as long as eb is dirty.
Signed-off-by Liu Bo <[email protected]>
I've reordered the patches so the assert comes first, before the actual conditional dirtying.