Re: [PATCH 03/55] xfs: complain if we don't get nextents bmap records

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 02, 2016 at 05:35:33PM -0800, Darrick J. Wong wrote:
> When reading into memory all extents of a btree-format inode fork,
> complain if the number of extents we find is not the same as the number
> of extents reported in the inode core.  This is needed to stop an IO
> action from accessing the garbage areas of the in-core fork.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ---
>  fs/xfs/libxfs/xfs_bmap.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 6f28814..9821161 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -1375,6 +1375,8 @@ xfs_bmap_read_extents(
>  			return error;
>  		block = XFS_BUF_TO_BLOCK(bp);
>  	}
> +	if (i != XFS_IFORK_NEXTENTS(ip, whichfork))
> +		return -EFSCORRUPTED;
>  	ASSERT(i == xfs_iext_count(ifp));
>  	ASSERT(i == XFS_IFORK_NEXTENTS(ip, whichfork));

This assert is now redundant and can be removed (which I've done).

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux