public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Eric Sandeen <sandeen@redhat.com>, linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH V2] xfs_metadump: properly handle obfuscation of all remote attribute blocks
Date: Tue, 1 Aug 2017 12:53:11 -0400	[thread overview]
Message-ID: <20170801165311.GB31130@bfoster.bfoster> (raw)
In-Reply-To: <1e034d9f-0e21-637d-c0e6-09d1b7e95027@sandeen.net>

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@redhat.com>
> ---
> 

Reviewed-by: Brian Foster <bfoster@redhat.com>

> 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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2017-08-01 16:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-26 20:35 [PATCH] xfs_metadump: properly handle obfuscation of all remote attribute blocks Eric Sandeen
2017-07-28 12:52 ` Brian Foster
2017-08-01 16:26   ` Eric Sandeen
2017-08-01 16:39 ` [PATCH V2] " Eric Sandeen
2017-08-01 16:53   ` Brian Foster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170801165311.GB31130@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox