xfs
[Top] [All Lists]

Re: [PATCH 3/4] xfs_db: show nlink fields for di_version == 3, too

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH 3/4] xfs_db: show nlink fields for di_version == 3, too
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Fri, 13 Mar 2015 09:20:18 -0400
Cc: Eric Sandeen <sandeen@xxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <54F7727F.8090808@xxxxxxxxxxx>
References: <54F77199.8030708@xxxxxxxxxx> <54F7727F.8090808@xxxxxxxxxxx>
User-agent: Mutt/1.5.23 (2014-03-12)
On Wed, Mar 04, 2015 at 03:00:47PM -0600, Eric Sandeen wrote:
> Printing inodes with di_version == 3 skips the nlink
> fields, because they are only printed if di_version == 2.
> This was intended to separate them from di_version == 1,
> but it mistakenly excluded di_version == 3, which also contains
> these fields.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> ---
> 
> Not sure; is >= 2 ok, or should it be == 2 || == 3?
> Choose your poison, I guess.
> 

Seems fine to me. I think it's better to only have to worry about this
code if something related to these fields changes rather than every time
a version update occurs.

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

> diff --git a/db/inode.c b/db/inode.c
> index 982acb7..c26e1a0 100644
> --- a/db/inode.c
> +++ b/db/inode.c
> @@ -369,7 +369,7 @@ inode_core_nlinkv2_count(
>       ASSERT(startoff == 0);
>       ASSERT(obj == iocur_top->data);
>       dic = obj;
> -     return dic->di_version == 2;
> +     return dic->di_version >= 2;
>  }
>  
>  static int
> @@ -382,7 +382,7 @@ inode_core_onlink_count(
>       ASSERT(startoff == 0);
>       ASSERT(obj == iocur_top->data);
>       dic = obj;
> -     return dic->di_version == 2;
> +     return dic->di_version >= 2;
>  }
>  
>  static int
> @@ -395,7 +395,7 @@ inode_core_projid_count(
>       ASSERT(startoff == 0);
>       ASSERT(obj == iocur_top->data);
>       dic = obj;
> -     return dic->di_version == 2;
> +     return dic->di_version >= 2;
>  }
>  
>  static int
> 
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

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