xfs
[Top] [All Lists]

Re: [patch] xfs: = vs == typo in ASSERT()

To: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Subject: Re: [patch] xfs: = vs == typo in ASSERT()
From: Dave Chinner <dchinner@xxxxxxxxxx>
Date: Wed, 11 Sep 2013 12:07:25 +1000
Cc: Ben Myers <bpm@xxxxxxx>, Alex Elder <elder@xxxxxxxxxx>, xfs@xxxxxxxxxxx, kernel-janitors@xxxxxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130911211731.GA10527@xxxxxxxxxxxxxx>
References: <20130911211731.GA10527@xxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
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@xxxxxxxxxx>
> ---
> 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@xxxxxxxxxx>

Thanks, Dan.

Cheers,

Dave.
-- 
Dave Chinner
dchinner@xxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>