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: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Wed, 11 Sep 2013 16:33:31 -0500
Cc: Ben Myers <bpm@xxxxxxx>, Dave Chinner <dchinner@xxxxxxxxxx>, Alex Elder <elder@xxxxxxxxxx>, kernel-janitors@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130911211731.GA10527@xxxxxxxxxxxxxx>
References: <20130911211731.GA10527@xxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
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@xxxxxxxxxx>

Reviewed-by: Eric Sandeen <sandeen@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);
>  
>       cur = xfs_bmbt_init_cursor(ip->i_mount, tp, ip, whichfork);
>       if (!cur)
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs
> 

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