* [PATCH] xfs: fix inverted return from xfs_btree_sblock_verify_crc
@ 2018-11-30 2:48 Eric Sandeen
2018-11-30 15:56 ` Darrick J. Wong
2018-12-02 16:06 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Eric Sandeen @ 2018-11-30 2:48 UTC (permalink / raw)
To: linux-xfs
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>
---
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);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] xfs: fix inverted return from xfs_btree_sblock_verify_crc
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
2018-12-02 16:06 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2018-11-30 15:56 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs
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);
> }
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] xfs: fix inverted return from xfs_btree_sblock_verify_crc
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
@ 2018-12-02 16:06 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2018-12-02 16:06 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs
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 good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-12-02 16:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2018-12-02 16:06 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox