public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: fix inverted return from xfs_btree_sblock_verify_crc
Date: Fri, 30 Nov 2018 07:56:39 -0800	[thread overview]
Message-ID: <20181130155639.GL8125@magnolia> (raw)
In-Reply-To: <28345031-dfa2-1d73-a36c-400e3c2333d1@redhat.com>

On Thu, Nov 29, 2018 at 08:48:25PM -0600, Eric Sandeen wrote:
> xfs_btree_sblock_verify_crc is a bool so should not be returning
> a failaddr_t; worse, if xfs_log_check_lsn fails it returns
> __this_address which looks like a boolean true (i.e. success)
> to the caller.
> 
> (interestingly xfs_btree_lblock_verify_crc doesn't have the issue)
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
> 
> diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
> index 34c6d7bd4d18..bbdae2b4559f 100644
> --- a/fs/xfs/libxfs/xfs_btree.c
> +++ b/fs/xfs/libxfs/xfs_btree.c
> @@ -330,7 +330,7 @@ xfs_btree_sblock_verify_crc(
>  
>  	if (xfs_sb_version_hascrc(&mp->m_sb)) {
>  		if (!xfs_log_check_lsn(mp, be64_to_cpu(block->bb_u.s.bb_lsn)))
> -			return __this_address;
> +			return false;
>  		return xfs_buf_verify_cksum(bp, XFS_BTREE_SBLOCK_CRC_OFF);
>  	}
>  
> 

  reply	other threads:[~2018-12-01  3:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30  2:48 [PATCH] xfs: fix inverted return from xfs_btree_sblock_verify_crc Eric Sandeen
2018-11-30 15:56 ` Darrick J. Wong [this message]
2018-12-02 16:06 ` Christoph Hellwig

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=20181130155639.GL8125@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.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