public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ben Myers <bpm@sgi.com>, Alex Elder <elder@kernel.org>,
	kernel-janitors@vger.kernel.org, xfs@oss.sgi.com,
	Dave Chinner <dchinner@redhat.com>
Subject: Re: [patch] xfs: = vs == typo in ASSERT()
Date: Wed, 11 Sep 2013 16:33:31 -0500	[thread overview]
Message-ID: <5230E1AB.9000909@sandeen.net> (raw)
In-Reply-To: <20130911211731.GA10527@elgon.mountain>

On 9/11/13 4:17 PM, Dan Carpenter wrote:
> There is a '=' vs '==' typo so the ASSERT()s are always true.

And worse, it assigns to di_format on a debug kernel, eek,
although should be modifying it to the thing it's supposed
to be anyway.  ;)  It's a self-healing ASSERT!  :)

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
> Introduced in 21b5c9784b ('xfs: swap extents operations for CRC
> filesystems')
> 
> diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c
> index 531b020..bb8de8e 100644
> --- a/fs/xfs/xfs_bmap_btree.c
> +++ b/fs/xfs/xfs_bmap_btree.c
> @@ -957,9 +957,9 @@ xfs_bmbt_change_owner(
>  	ASSERT(tp || buffer_list);
>  	ASSERT(!(tp && buffer_list));
>  	if (whichfork == XFS_DATA_FORK)
> -		ASSERT(ip->i_d.di_format = XFS_DINODE_FMT_BTREE);
> +		ASSERT(ip->i_d.di_format == XFS_DINODE_FMT_BTREE);
>  	else
> -		ASSERT(ip->i_d.di_aformat = XFS_DINODE_FMT_BTREE);
> +		ASSERT(ip->i_d.di_aformat == XFS_DINODE_FMT_BTREE);
>  
>  	cur = xfs_bmbt_init_cursor(ip->i_mount, tp, ip, whichfork);
>  	if (!cur)
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2013-09-11 21:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11 21:17 [patch] xfs: = vs == typo in ASSERT() Dan Carpenter
2013-09-11  2:07 ` Dave Chinner
2013-09-11 21:33 ` Eric Sandeen [this message]
2013-09-12 14:50 ` Ben Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5230E1AB.9000909@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=bpm@sgi.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dchinner@redhat.com \
    --cc=elder@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox