Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1723750 > unrolled thread

linux-next: build warning after merge of the xfs tree

Started byStephen Rothwell <sfr@canb.auug.org.au>
First post2017-08-31 02:10 +0200
Last post2017-08-31 23:40 +0200
Articles 6 — 4 participants

Back to article view | Back to linux.kernel


Contents

  linux-next: build warning after merge of the xfs tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-08-31 02:10 +0200
    Re: linux-next: build warning after merge of the xfs tree Brian Foster <bfoster@redhat.com> - 2017-08-31 12:40 +0200
      Re: linux-next: build warning after merge of the xfs tree "Darrick J. Wong" <darrick.wong@oracle.com> - 2017-08-31 17:00 +0200
        Re: linux-next: build warning after merge of the xfs tree Brian Foster <bfoster@redhat.com> - 2017-08-31 17:30 +0200
          Re: linux-next: build warning after merge of the xfs tree "Darrick J. Wong" <darrick.wong@oracle.com> - 2017-08-31 17:50 +0200
          Re: linux-next: build warning after merge of the xfs tree Dave Chinner <david@fromorbit.com> - 2017-08-31 23:40 +0200

#1723750 — linux-next: build warning after merge of the xfs tree

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2017-08-31 02:10 +0200
Subjectlinux-next: build warning after merge of the xfs tree
Message-ID<ukldw-6KE-5@gated-at.bofh.it>
Hi all,

After merging the xfs tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:

fs/xfs/xfs_buf_item.c: In function 'xfs_buf_item_unlock':
fs/xfs/xfs_buf_item.c:573:9: warning: unused variable 'ordered' [-Wunused-variable]
  bool   ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
         ^

Introduced by commit

  a097077ef708 ("xfs: remove unnecessary dirty bli format check for ordered bufs")

-- 
Cheers,
Stephen Rothwell

[toc] | [next] | [standalone]


#1724088

FromBrian Foster <bfoster@redhat.com>
Date2017-08-31 12:40 +0200
Message-ID<ukv3c-4rE-25@gated-at.bofh.it>
In reply to#1723750
On Thu, Aug 31, 2017 at 10:07:03AM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the xfs tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
> 
> fs/xfs/xfs_buf_item.c: In function 'xfs_buf_item_unlock':
> fs/xfs/xfs_buf_item.c:573:9: warning: unused variable 'ordered' [-Wunused-variable]
>   bool   ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
>          ^
> 
> Introduced by commit
> 
>   a097077ef708 ("xfs: remove unnecessary dirty bli format check for ordered bufs")
> 

Ugh, this is due to the refactoring of this patch between v1 and v2. I
specifically recall testing for this in v1 because I added the ordered
bool purely to clean up the ASSERT(), then I apparently lost of track of
it for v2.

Anyways.. Christoph, Darrick, preferences to clean this up..? I have no
preference between the v1 or v2 factoring. Or if it's easier, we could
always just drop something like the hunk below on top. Thoughts?

Brian

--- 8< ---

diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index ef2c137..f5d25f5 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -567,10 +567,15 @@ xfs_buf_item_unlock(
 {
 	struct xfs_buf_log_item	*bip = BUF_ITEM(lip);
 	struct xfs_buf		*bp = bip->bli_buf;
-	bool			aborted = !!(lip->li_flags & XFS_LI_ABORTED);
-	bool			hold = !!(bip->bli_flags & XFS_BLI_HOLD);
-	bool			dirty = !!(bip->bli_flags & XFS_BLI_DIRTY);
-	bool			ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
+	bool			aborted;
+	bool			hold;
+	bool			dirty;
+	bool			ordered;
+
+	aborted = !!(lip->li_flags & XFS_LI_ABORTED);
+	hold = !!(bip->bli_flags & XFS_BLI_HOLD);
+	dirty = !!(bip->bli_flags & XFS_BLI_DIRTY);
+	ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
 
 	/* Clear the buffer's association with this transaction. */
 	bp->b_transp = NULL;

[toc] | [prev] | [next] | [standalone]


#1724294

From"Darrick J. Wong" <darrick.wong@oracle.com>
Date2017-08-31 17:00 +0200
Message-ID<ukz6N-6TE-1@gated-at.bofh.it>
In reply to#1724088
On Thu, Aug 31, 2017 at 06:30:41AM -0400, Brian Foster wrote:
> On Thu, Aug 31, 2017 at 10:07:03AM +1000, Stephen Rothwell wrote:
> > Hi all,
> > 
> > After merging the xfs tree, today's linux-next build (powerpc
> > ppc64_defconfig) produced this warning:
> > 
> > fs/xfs/xfs_buf_item.c: In function 'xfs_buf_item_unlock':
> > fs/xfs/xfs_buf_item.c:573:9: warning: unused variable 'ordered' [-Wunused-variable]
> >   bool   ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
> >          ^
> > 
> > Introduced by commit
> > 
> >   a097077ef708 ("xfs: remove unnecessary dirty bli format check for ordered bufs")
> > 
> 
> Ugh, this is due to the refactoring of this patch between v1 and v2. I
> specifically recall testing for this in v1 because I added the ordered
> bool purely to clean up the ASSERT(), then I apparently lost of track of
> it for v2.
> 
> Anyways.. Christoph, Darrick, preferences to clean this up..? I have no
> preference between the v1 or v2 factoring. Or if it's easier, we could
> always just drop something like the hunk below on top. Thoughts?
> 
> Brian
> 
> --- 8< ---
> 
> diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
> index ef2c137..f5d25f5 100644
> --- a/fs/xfs/xfs_buf_item.c
> +++ b/fs/xfs/xfs_buf_item.c
> @@ -567,10 +567,15 @@ xfs_buf_item_unlock(
>  {
>  	struct xfs_buf_log_item	*bip = BUF_ITEM(lip);
>  	struct xfs_buf		*bp = bip->bli_buf;
> -	bool			aborted = !!(lip->li_flags & XFS_LI_ABORTED);
> -	bool			hold = !!(bip->bli_flags & XFS_BLI_HOLD);
> -	bool			dirty = !!(bip->bli_flags & XFS_BLI_DIRTY);
> -	bool			ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
> +	bool			aborted;
> +	bool			hold;
> +	bool			dirty;
> +	bool			ordered;
> +
> +	aborted = !!(lip->li_flags & XFS_LI_ABORTED);
> +	hold = !!(bip->bli_flags & XFS_BLI_HOLD);
> +	dirty = !!(bip->bli_flags & XFS_BLI_DIRTY);
> +	ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);

The trouble is, 'ordered' is still an unused variable on !DEBUG builds,
since the only user of ordered is that ASSERT.  So either we #ifdef
DEBUG the variable out of existence or employ one of those silly
'ordered = ordered' constructions to shut up gcc, if that even still
works.

--D

>  
>  	/* Clear the buffer's association with this transaction. */
>  	bp->b_transp = NULL;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [prev] | [next] | [standalone]


#1724319

FromBrian Foster <bfoster@redhat.com>
Date2017-08-31 17:30 +0200
Message-ID<ukzzP-7k7-15@gated-at.bofh.it>
In reply to#1724294
On Thu, Aug 31, 2017 at 07:57:52AM -0700, Darrick J. Wong wrote:
> On Thu, Aug 31, 2017 at 06:30:41AM -0400, Brian Foster wrote:
> > On Thu, Aug 31, 2017 at 10:07:03AM +1000, Stephen Rothwell wrote:
> > > Hi all,
> > > 
> > > After merging the xfs tree, today's linux-next build (powerpc
> > > ppc64_defconfig) produced this warning:
> > > 
> > > fs/xfs/xfs_buf_item.c: In function 'xfs_buf_item_unlock':
> > > fs/xfs/xfs_buf_item.c:573:9: warning: unused variable 'ordered' [-Wunused-variable]
> > >   bool   ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
> > >          ^
> > > 
> > > Introduced by commit
> > > 
> > >   a097077ef708 ("xfs: remove unnecessary dirty bli format check for ordered bufs")
> > > 
> > 
> > Ugh, this is due to the refactoring of this patch between v1 and v2. I
> > specifically recall testing for this in v1 because I added the ordered
> > bool purely to clean up the ASSERT(), then I apparently lost of track of
> > it for v2.
> > 
> > Anyways.. Christoph, Darrick, preferences to clean this up..? I have no
> > preference between the v1 or v2 factoring. Or if it's easier, we could
> > always just drop something like the hunk below on top. Thoughts?
> > 
> > Brian
> > 
> > --- 8< ---
> > 
> > diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
> > index ef2c137..f5d25f5 100644
> > --- a/fs/xfs/xfs_buf_item.c
> > +++ b/fs/xfs/xfs_buf_item.c
> > @@ -567,10 +567,15 @@ xfs_buf_item_unlock(
> >  {
> >  	struct xfs_buf_log_item	*bip = BUF_ITEM(lip);
> >  	struct xfs_buf		*bp = bip->bli_buf;
> > -	bool			aborted = !!(lip->li_flags & XFS_LI_ABORTED);
> > -	bool			hold = !!(bip->bli_flags & XFS_BLI_HOLD);
> > -	bool			dirty = !!(bip->bli_flags & XFS_BLI_DIRTY);
> > -	bool			ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
> > +	bool			aborted;
> > +	bool			hold;
> > +	bool			dirty;
> > +	bool			ordered;
> > +
> > +	aborted = !!(lip->li_flags & XFS_LI_ABORTED);
> > +	hold = !!(bip->bli_flags & XFS_BLI_HOLD);
> > +	dirty = !!(bip->bli_flags & XFS_BLI_DIRTY);
> > +	ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
> 
> The trouble is, 'ordered' is still an unused variable on !DEBUG builds,
> since the only user of ordered is that ASSERT.  So either we #ifdef
> DEBUG the variable out of existence or employ one of those silly
> 'ordered = ordered' constructions to shut up gcc, if that even still
> works.
> 

The warning goes away for me if we separate the initialization of
ordered from the declaration. Do you observe otherwise?

Brian

> --D
> 
> >  
> >  	/* Clear the buffer's association with this transaction. */
> >  	bp->b_transp = NULL;
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [prev] | [next] | [standalone]


#1724347

From"Darrick J. Wong" <darrick.wong@oracle.com>
Date2017-08-31 17:50 +0200
Message-ID<ukzTd-7qZ-47@gated-at.bofh.it>
In reply to#1724319
On Thu, Aug 31, 2017 at 11:22:20AM -0400, Brian Foster wrote:
> On Thu, Aug 31, 2017 at 07:57:52AM -0700, Darrick J. Wong wrote:
> > On Thu, Aug 31, 2017 at 06:30:41AM -0400, Brian Foster wrote:
> > > On Thu, Aug 31, 2017 at 10:07:03AM +1000, Stephen Rothwell wrote:
> > > > Hi all,
> > > > 
> > > > After merging the xfs tree, today's linux-next build (powerpc
> > > > ppc64_defconfig) produced this warning:
> > > > 
> > > > fs/xfs/xfs_buf_item.c: In function 'xfs_buf_item_unlock':
> > > > fs/xfs/xfs_buf_item.c:573:9: warning: unused variable 'ordered' [-Wunused-variable]
> > > >   bool   ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
> > > >          ^
> > > > 
> > > > Introduced by commit
> > > > 
> > > >   a097077ef708 ("xfs: remove unnecessary dirty bli format check for ordered bufs")
> > > > 
> > > 
> > > Ugh, this is due to the refactoring of this patch between v1 and v2. I
> > > specifically recall testing for this in v1 because I added the ordered
> > > bool purely to clean up the ASSERT(), then I apparently lost of track of
> > > it for v2.
> > > 
> > > Anyways.. Christoph, Darrick, preferences to clean this up..? I have no
> > > preference between the v1 or v2 factoring. Or if it's easier, we could
> > > always just drop something like the hunk below on top. Thoughts?
> > > 
> > > Brian
> > > 
> > > --- 8< ---
> > > 
> > > diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
> > > index ef2c137..f5d25f5 100644
> > > --- a/fs/xfs/xfs_buf_item.c
> > > +++ b/fs/xfs/xfs_buf_item.c
> > > @@ -567,10 +567,15 @@ xfs_buf_item_unlock(
> > >  {
> > >  	struct xfs_buf_log_item	*bip = BUF_ITEM(lip);
> > >  	struct xfs_buf		*bp = bip->bli_buf;
> > > -	bool			aborted = !!(lip->li_flags & XFS_LI_ABORTED);
> > > -	bool			hold = !!(bip->bli_flags & XFS_BLI_HOLD);
> > > -	bool			dirty = !!(bip->bli_flags & XFS_BLI_DIRTY);
> > > -	bool			ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
> > > +	bool			aborted;
> > > +	bool			hold;
> > > +	bool			dirty;
> > > +	bool			ordered;
> > > +
> > > +	aborted = !!(lip->li_flags & XFS_LI_ABORTED);
> > > +	hold = !!(bip->bli_flags & XFS_BLI_HOLD);
> > > +	dirty = !!(bip->bli_flags & XFS_BLI_DIRTY);
> > > +	ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
> > 
> > The trouble is, 'ordered' is still an unused variable on !DEBUG builds,
> > since the only user of ordered is that ASSERT.  So either we #ifdef
> > DEBUG the variable out of existence or employ one of those silly
> > 'ordered = ordered' constructions to shut up gcc, if that even still
> > works.
> > 
> 
> The warning goes away for me if we separate the initialization of
> ordered from the declaration. Do you observe otherwise?

Hm.  Seems to shut up gcc, so I guess it's fine.  In the past it would
whine, but I guess they fixed it or something.

Want to send it as a real [PATCH]?

--D

> 
> Brian
> 
> > --D
> > 
> > >  
> > >  	/* Clear the buffer's association with this transaction. */
> > >  	bp->b_transp = NULL;
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [prev] | [next] | [standalone]


#1724609

FromDave Chinner <david@fromorbit.com>
Date2017-08-31 23:40 +0200
Message-ID<ukFlT-2Gx-1@gated-at.bofh.it>
In reply to#1724319
On Thu, Aug 31, 2017 at 11:22:20AM -0400, Brian Foster wrote:
> On Thu, Aug 31, 2017 at 07:57:52AM -0700, Darrick J. Wong wrote:
> > On Thu, Aug 31, 2017 at 06:30:41AM -0400, Brian Foster wrote:
> > > On Thu, Aug 31, 2017 at 10:07:03AM +1000, Stephen Rothwell wrote:
> > > > Hi all,
> > > > 
> > > > After merging the xfs tree, today's linux-next build (powerpc
> > > > ppc64_defconfig) produced this warning:
> > > > 
> > > > fs/xfs/xfs_buf_item.c: In function 'xfs_buf_item_unlock':
> > > > fs/xfs/xfs_buf_item.c:573:9: warning: unused variable 'ordered' [-Wunused-variable]
> > > >   bool   ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
> > > >          ^
> > > > 
> > > > Introduced by commit
> > > > 
> > > >   a097077ef708 ("xfs: remove unnecessary dirty bli format check for ordered bufs")
> > > > 
> > > 
> > > Ugh, this is due to the refactoring of this patch between v1 and v2. I
> > > specifically recall testing for this in v1 because I added the ordered
> > > bool purely to clean up the ASSERT(), then I apparently lost of track of
> > > it for v2.
> > > 
> > > Anyways.. Christoph, Darrick, preferences to clean this up..? I have no
> > > preference between the v1 or v2 factoring. Or if it's easier, we could
> > > always just drop something like the hunk below on top. Thoughts?
> > > 
> > > Brian
> > > 
> > > --- 8< ---
> > > 
> > > diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
> > > index ef2c137..f5d25f5 100644
> > > --- a/fs/xfs/xfs_buf_item.c
> > > +++ b/fs/xfs/xfs_buf_item.c
> > > @@ -567,10 +567,15 @@ xfs_buf_item_unlock(
> > >  {
> > >  	struct xfs_buf_log_item	*bip = BUF_ITEM(lip);
> > >  	struct xfs_buf		*bp = bip->bli_buf;
> > > -	bool			aborted = !!(lip->li_flags & XFS_LI_ABORTED);
> > > -	bool			hold = !!(bip->bli_flags & XFS_BLI_HOLD);
> > > -	bool			dirty = !!(bip->bli_flags & XFS_BLI_DIRTY);
> > > -	bool			ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
> > > +	bool			aborted;
> > > +	bool			hold;
> > > +	bool			dirty;
> > > +	bool			ordered;
> > > +
> > > +	aborted = !!(lip->li_flags & XFS_LI_ABORTED);
> > > +	hold = !!(bip->bli_flags & XFS_BLI_HOLD);
> > > +	dirty = !!(bip->bli_flags & XFS_BLI_DIRTY);
> > > +	ordered = !!(bip->bli_flags & XFS_BLI_ORDERED);
> > 
> > The trouble is, 'ordered' is still an unused variable on !DEBUG builds,
> > since the only user of ordered is that ASSERT.  So either we #ifdef
> > DEBUG the variable out of existence or employ one of those silly
> > 'ordered = ordered' constructions to shut up gcc, if that even still
> > works.
> > 
> 
> The warning goes away for me if we separate the initialization of
> ordered from the declaration. Do you observe otherwise?

Various versions of gcc will throw set-but-unused warnings on
this. Just #define it away or factor the debug code into another
function.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web