Re: [PATCH V2] xfs_metadump: properly handle obfuscation of all remote attribute blocks

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

 



On Tue, Aug 01, 2017 at 11:39:19AM -0500, Eric Sandeen wrote:
> add_remote_vals assumes that it can subtract blocksize
> from each block that it processes, but with CRCs, there
> is a header on each block, so the assumption that each
> block consumes $BLOCKSIZE of the value length is incorrect.
> 
> This causes us to stop adding remote blocks too soon, and
> the missed blocks do not get obfuscated.
> 
> Fix this by accounting for the header size as appropriate,
> depending on whether or not we have a CRC filesystem.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> ---
> 

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

> V2: Use helper macro, don't send mp as arg (it's a global (!))
> 
> diff --git a/db/metadump.c b/db/metadump.c
> index 96641e0..f60bd32 100644
> --- a/db/metadump.c
> +++ b/db/metadump.c
> @@ -1609,7 +1609,7 @@ add_remote_vals(
>  		attr_data.remote_vals[attr_data.remote_val_count] = blockidx;
>  		attr_data.remote_val_count++;
>  		blockidx++;
> -		length -= mp->m_sb.sb_blocksize;
> +		length -= XFS_ATTR3_RMT_BUF_SPACE(mp, mp->m_sb.sb_blocksize);
>  	}
>  
>  	if (attr_data.remote_val_count >= MAX_REMOTE_VALS) {
> 
> --
> 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
--
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