From: Dave Chinner <dchinner@redhat.com>
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
Subject: Re: [patch] xfs: = vs == typo in ASSERT()
Date: Wed, 11 Sep 2013 12:07:25 +1000 [thread overview]
Message-ID: <20130911020725.GE2445@devil.localdomain> (raw)
In-Reply-To: <20130911211731.GA10527@elgon.mountain>
On Thu, Sep 12, 2013 at 12:17:31AM +0300, Dan Carpenter wrote:
> There is a '=' vs '==' typo so the ASSERT()s are always true.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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);
>
Eek!
Well, actually, it's harmless, because the only callers of that
function do so after checking that ip->i_d.di_format ==
XFS_DINODE_FMT_BTREE.
So, the fix is definitely needed, but it's not as bad as it looks.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Thanks, Dan.
Cheers,
Dave.
--
Dave Chinner
dchinner@redhat.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-09-11 22:29 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 [this message]
2013-09-11 21:33 ` Eric Sandeen
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=20130911020725.GE2445@devil.localdomain \
--to=dchinner@redhat.com \
--cc=bpm@sgi.com \
--cc=dan.carpenter@oracle.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