All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Btrfs: assert page dirty bit
@ 2018-09-11 22:06 Liu Bo
  2018-09-12  6:38 ` Nikolay Borisov
  2018-09-13 17:46 ` [PATCH v2] " Liu Bo
  0 siblings, 2 replies; 6+ messages in thread
From: Liu Bo @ 2018-09-11 22:06 UTC (permalink / raw)
  To: linux-btrfs

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

Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
---
 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..99895f196ecb 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 BTRFS_DEBUG
+	for (i = 0; i < num_pages; i++)
+		ASSERT(PageDirty(eb->pages[i]));
+#endif
+
 	return was_dirty;
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Btrfs: assert page dirty bit
  2018-09-11 22:06 [PATCH] Btrfs: assert page dirty bit Liu Bo
@ 2018-09-12  6:38 ` Nikolay Borisov
  2018-09-12 19:28   ` Liu Bo
  2018-09-13 17:46 ` [PATCH v2] " Liu Bo
  1 sibling, 1 reply; 6+ messages in thread
From: Nikolay Borisov @ 2018-09-12  6:38 UTC (permalink / raw)
  To: Liu Bo, linux-btrfs



On 12.09.2018 01:06, Liu Bo wrote:
> Just in case that someone breaks the rule that pages are dirty as long
> as eb is dirty.
> 
> Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
> ---
>  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..99895f196ecb 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 BTRFS_DEBUG

And this will never be compiled since the actual ifdef name is
"CONFIG_BTRFS_DEBUG"

> +	for (i = 0; i < num_pages; i++)
> +		ASSERT(PageDirty(eb->pages[i]));
> +#endif
> +
>  	return was_dirty;
>  }
>  
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Btrfs: assert page dirty bit
  2018-09-12  6:38 ` Nikolay Borisov
@ 2018-09-12 19:28   ` Liu Bo
  0 siblings, 0 replies; 6+ messages in thread
From: Liu Bo @ 2018-09-12 19:28 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: linux-btrfs

On Wed, Sep 12, 2018 at 09:38:49AM +0300, Nikolay Borisov wrote:
> 
> 
> On 12.09.2018 01:06, Liu Bo wrote:
> > Just in case that someone breaks the rule that pages are dirty as long
> > as eb is dirty.
> > 
> > Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
> > ---
> >  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..99895f196ecb 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 BTRFS_DEBUG
> 
> And this will never be compiled since the actual ifdef name is
> "CONFIG_BTRFS_DEBUG"
>

Oops, will fix it.

thanks,
-liubo

> > +	for (i = 0; i < num_pages; i++)
> > +		ASSERT(PageDirty(eb->pages[i]));
> > +#endif
> > +
> >  	return was_dirty;
> >  }
> >  
> > 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] Btrfs: assert page dirty bit
  2018-09-11 22:06 [PATCH] Btrfs: assert page dirty bit Liu Bo
  2018-09-12  6:38 ` Nikolay Borisov
@ 2018-09-13 17:46 ` Liu Bo
  2018-09-14  6:24   ` Nikolay Borisov
  2018-09-14 12:55   ` David Sterba
  1 sibling, 2 replies; 6+ messages in thread
From: Liu Bo @ 2018-09-13 17:46 UTC (permalink / raw)
  To: linux-btrfs

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

Signed-off-by: Liu Bo <bo.liu@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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] Btrfs: assert page dirty bit
  2018-09-13 17:46 ` [PATCH v2] " Liu Bo
@ 2018-09-14  6:24   ` Nikolay Borisov
  2018-09-14 12:55   ` David Sterba
  1 sibling, 0 replies; 6+ messages in thread
From: Nikolay Borisov @ 2018-09-14  6:24 UTC (permalink / raw)
  To: Liu Bo, linux-btrfs



On 13.09.2018 20:46, Liu Bo wrote:
> Just in case that someone breaks the rule that pages are dirty as long
> as eb is dirty.
> 
> Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.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;
>  }
>  
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] Btrfs: assert page dirty bit
  2018-09-13 17:46 ` [PATCH v2] " Liu Bo
  2018-09-14  6:24   ` Nikolay Borisov
@ 2018-09-14 12:55   ` David Sterba
  1 sibling, 0 replies; 6+ messages in thread
From: David Sterba @ 2018-09-14 12:55 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs

On Fri, Sep 14, 2018 at 01:46:08AM +0800, Liu Bo wrote:
> Just in case that someone breaks the rule that pages are dirty as long
> as eb is dirty.
> 
> Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>

Reviewed-by: David Sterba <dsterba@suse.com>

I've reordered the patches so the assert comes first, before the actual
conditional dirtying.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-14 18:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 22:06 [PATCH] Btrfs: assert page dirty bit Liu Bo
2018-09-12  6:38 ` Nikolay Borisov
2018-09-12 19:28   ` Liu Bo
2018-09-13 17:46 ` [PATCH v2] " Liu Bo
2018-09-14  6:24   ` Nikolay Borisov
2018-09-14 12:55   ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.