[PATCH 6/8] xfs: make xfs_inode_item_size idempotent

Dave Chinner david at fromorbit.com
Mon Feb 20 23:14:04 CST 2012


On Mon, Feb 20, 2012 at 07:38:30PM -0500, Christoph Hellwig wrote:
> Move all code messing with the inode log item flags into xfs_inode_item_format
> to make sure xfs_inode_item_size really only calculates the the number of
> vectors, but doesn't modify any state of the inode item.
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>

Looks ok so:

Reviewed-by: Dave Chinner <dchinner at redhat.com>

One minor cleanup:

>  	case XFS_DINODE_FMT_LOCAL:
> -		ASSERT(!(iip->ili_format.ilf_fields &
> -			 (XFS_ILOG_ABROOT | XFS_ILOG_AEXT)));
> -		if (iip->ili_format.ilf_fields & XFS_ILOG_ADATA) {
> +		iip->ili_format.ilf_fields &=
> +			~(XFS_ILOG_AEXT | XFS_ILOG_ABROOT);
> +
> +		if ((iip->ili_format.ilf_fields & XFS_ILOG_ADATA) &&
> +		    ip->i_afp->if_bytes > 0) {
>  			ASSERT(ip->i_afp->if_bytes > 0);

That assert can go - it's checked in the if statement now.

Cheers,

Dave.
-- 
Dave Chinner
david at fromorbit.com



More information about the xfs mailing list