diff mbox series

[20/36] xfs_db: fix finobt record decoding when sparse inodes enabled

Message ID 155259755345.31886.7689089384611545119.stgit@magnolia (mailing list archive)
State Not Applicable
Headers show
Series xfsprogs-5.0: fix various problems | expand

Commit Message

Darrick J. Wong March 14, 2019, 9:05 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Use the sparse inobt record field decoder (inobt_spcrc_hfld) to decode
finobt records when sparse inodes are enabled.  Otherwise, xfs_db
prints out bogus things like:

recs[1] = [startino,freecount,free]
1:[214720,16429,0xfffffffffff80000]

There can never be 16429 records in an inode btree record; instead it
should print:

recs[1] = [startino,holemask,count,freecount,free]
1:[214720,0,64,45,0xfffffffffff80000]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 db/type.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Sandeen March 26, 2019, 5:05 p.m. UTC | #1
On 3/14/19 4:05 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Use the sparse inobt record field decoder (inobt_spcrc_hfld) to decode
> finobt records when sparse inodes are enabled.  Otherwise, xfs_db
> prints out bogus things like:
> 
> recs[1] = [startino,freecount,free]
> 1:[214720,16429,0xfffffffffff80000]
> 
> There can never be 16429 records in an inode btree record; instead it
> should print:
> 
> recs[1] = [startino,holemask,count,freecount,free]
> 1:[214720,0,64,45,0xfffffffffff80000]
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Um... :) 

commit 38c599e7782ced7d2d1b41c3182daeaddad2cee4
Author: Darrick J. Wong <darrick.wong@oracle.com>
Date:   Mon Jan 28 13:03:15 2019 -0600

    xfs_db: fix finobt record decoding when sparse inodes enabled
    
    Use the sparse inobt record field decoder (inobt_spcrc_hfld) to decode
    finobt records when sparse inodes are enabled.  Otherwise, xfs_db
    prints out bogus things like:
    
    recs[1] = [startino,freecount,free]
    1:[214720,16429,0xfffffffffff80000]
    
    There can never be 16429 records in an inode btree record; instead it
    should print:
    
    recs[1] = [startino,holemask,count,freecount,free]
    1:[214720,0,64,45,0xfffffffffff80000]
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
    Reviewed-by: Dave Chinner <dchinner@redhat.com>
    Signed-off-by: Eric Sandeen <sandeen@sandeen.net>

> ---
>  db/type.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> diff --git a/db/type.c b/db/type.c
> index f5f65042..d42935a2 100644
> --- a/db/type.c
> +++ b/db/type.c
> @@ -107,7 +107,7 @@ static const typ_t	__typtab_crc[] = {
>  	{ TYP_SYMLINK, "symlink", handle_struct, symlink_crc_hfld,
>  		&xfs_symlink_buf_ops, XFS_SYMLINK_CRC_OFF },
>  	{ TYP_TEXT, "text", handle_text, NULL, NULL, TYP_F_NO_CRC_OFF },
> -	{ TYP_FINOBT, "finobt", handle_struct, inobt_crc_hfld,
> +	{ TYP_FINOBT, "finobt", handle_struct, inobt_spcrc_hfld,
>  		&xfs_inobt_buf_ops, XFS_BTREE_SBLOCK_CRC_OFF },
>  	{ TYP_NONE, NULL }
>  };
>
Darrick J. Wong March 26, 2019, 5:08 p.m. UTC | #2
On Tue, Mar 26, 2019 at 12:05:04PM -0500, Eric Sandeen wrote:
> On 3/14/19 4:05 PM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Use the sparse inobt record field decoder (inobt_spcrc_hfld) to decode
> > finobt records when sparse inodes are enabled.  Otherwise, xfs_db
> > prints out bogus things like:
> > 
> > recs[1] = [startino,freecount,free]
> > 1:[214720,16429,0xfffffffffff80000]
> > 
> > There can never be 16429 records in an inode btree record; instead it
> > should print:
> > 
> > recs[1] = [startino,holemask,count,freecount,free]
> > 1:[214720,0,64,45,0xfffffffffff80000]
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Um... :) 
> 
> commit 38c599e7782ced7d2d1b41c3182daeaddad2cee4
> Author: Darrick J. Wong <darrick.wong@oracle.com>
> Date:   Mon Jan 28 13:03:15 2019 -0600
> 
>     xfs_db: fix finobt record decoding when sparse inodes enabled
>     
>     Use the sparse inobt record field decoder (inobt_spcrc_hfld) to decode
>     finobt records when sparse inodes are enabled.  Otherwise, xfs_db
>     prints out bogus things like:
>     
>     recs[1] = [startino,freecount,free]
>     1:[214720,16429,0xfffffffffff80000]
>     
>     There can never be 16429 records in an inode btree record; instead it
>     should print:
>     
>     recs[1] = [startino,holemask,count,freecount,free]
>     1:[214720,0,64,45,0xfffffffffff80000]
>     
>     Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
>     Reviewed-by: Dave Chinner <dchinner@redhat.com>
>     Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
> 
> > ---
> >  db/type.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > 
> > diff --git a/db/type.c b/db/type.c
> > index f5f65042..d42935a2 100644
> > --- a/db/type.c
> > +++ b/db/type.c
> > @@ -107,7 +107,7 @@ static const typ_t	__typtab_crc[] = {

Heh.  Apparently the stgit rebase didn't notice that this patch was
already applied and cleverly went and broke non-sparse finobt.  And then
I didn't notice either. :( :(

Strike this patch, please.

--D

> >  	{ TYP_SYMLINK, "symlink", handle_struct, symlink_crc_hfld,
> >  		&xfs_symlink_buf_ops, XFS_SYMLINK_CRC_OFF },
> >  	{ TYP_TEXT, "text", handle_text, NULL, NULL, TYP_F_NO_CRC_OFF },
> > -	{ TYP_FINOBT, "finobt", handle_struct, inobt_crc_hfld,
> > +	{ TYP_FINOBT, "finobt", handle_struct, inobt_spcrc_hfld,
> >  		&xfs_inobt_buf_ops, XFS_BTREE_SBLOCK_CRC_OFF },
> >  	{ TYP_NONE, NULL }
> >  };
> >
diff mbox series

Patch

diff --git a/db/type.c b/db/type.c
index f5f65042..d42935a2 100644
--- a/db/type.c
+++ b/db/type.c
@@ -107,7 +107,7 @@  static const typ_t	__typtab_crc[] = {
 	{ TYP_SYMLINK, "symlink", handle_struct, symlink_crc_hfld,
 		&xfs_symlink_buf_ops, XFS_SYMLINK_CRC_OFF },
 	{ TYP_TEXT, "text", handle_text, NULL, NULL, TYP_F_NO_CRC_OFF },
-	{ TYP_FINOBT, "finobt", handle_struct, inobt_crc_hfld,
+	{ TYP_FINOBT, "finobt", handle_struct, inobt_spcrc_hfld,
 		&xfs_inobt_buf_ops, XFS_BTREE_SBLOCK_CRC_OFF },
 	{ TYP_NONE, NULL }
 };