[2/3] xfs_db: fix rdbmap_boundscheck
diff mbox series

Message ID 158984954380.623441.11000410439582315428.stgit@magnolia
State Accepted
Headers show
Series
  • xfsprogs: random fixes
Related show

Commit Message

Darrick J. Wong May 19, 2020, 12:52 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

This predicate should check the a rt block number against number of
rtblocks, not the number of AG blocks.  Ooops.

Fixes: 7161cd21b3ed ("xfs_db: bounds-check access to the dbmap array")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 db/check.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Sandeen May 19, 2020, 1:57 a.m. UTC | #1
On 5/18/20 7:52 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> This predicate should check the a rt block number against number of
> rtblocks, not the number of AG blocks.  Ooops.
> 
> Fixes: 7161cd21b3ed ("xfs_db: bounds-check access to the dbmap array")
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

welp, sorry I missed this on regression testing;.

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  db/check.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> diff --git a/db/check.c b/db/check.c
> index c6fce605..12c03b6d 100644
> --- a/db/check.c
> +++ b/db/check.c
> @@ -1490,7 +1490,7 @@ static inline bool
>  rdbmap_boundscheck(
>  	xfs_rfsblock_t	bno)
>  {
> -	return bno < mp->m_sb.sb_agblocks;
> +	return bno < mp->m_sb.sb_rblocks;
>  }
>  
>  static void
>
Christoph Hellwig May 20, 2020, 5:36 p.m. UTC | #2
On Mon, May 18, 2020 at 05:52:23PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> This predicate should check the a rt block number against number of
> rtblocks, not the number of AG blocks.  Ooops.
> 
> Fixes: 7161cd21b3ed ("xfs_db: bounds-check access to the dbmap array")
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

Patch
diff mbox series

diff --git a/db/check.c b/db/check.c
index c6fce605..12c03b6d 100644
--- a/db/check.c
+++ b/db/check.c
@@ -1490,7 +1490,7 @@  static inline bool
 rdbmap_boundscheck(
 	xfs_rfsblock_t	bno)
 {
-	return bno < mp->m_sb.sb_agblocks;
+	return bno < mp->m_sb.sb_rblocks;
 }
 
 static void