From: Brian Foster <bfoster@redhat.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs@oss.sgi.com
Subject: Re: [PATCH 4/4 V2] xfsprogs: zero out clean log in xfs_metadump
Date: Mon, 8 Jun 2015 14:29:47 -0400 [thread overview]
Message-ID: <20150608182947.GA18211@bfoster.bfoster> (raw)
In-Reply-To: <5575AF7A.8050306@sandeen.net>
On Mon, Jun 08, 2015 at 10:06:34AM -0500, Eric Sandeen wrote:
> When doing an obfuscated xfs_metadump, if the log is clean, zero
> it out for 2 reasons:
>
> * It'll make the image more compressible
> * It'll eliminate an un-obfuscated metadata source
>
> If the log isn't clean, and the user expected obfuscation, warn
> that metadata in the log will not be obfuscated.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> V2: If not obfuscating, copy log as-is
>
FYI, I think v1 of this was already pulled into the for-next branch.
Anyways...
> diff --git a/db/metadump.c b/db/metadump.c
> index bea4e00..67de0c5 100644
> --- a/db/metadump.c
> +++ b/db/metadump.c
> @@ -17,6 +17,7 @@
> */
>
> #include <libxfs.h>
> +#include <libxlog.h>
> #include "bmap.h"
> #include "command.h"
> #include "metadump.h"
> @@ -2169,6 +2170,8 @@ copy_sb_inodes(void)
> static int
> copy_log(void)
> {
> + int dirty;
> +
> if (show_progress)
> print_progress("Copying log");
>
> @@ -2180,6 +2183,36 @@ copy_log(void)
> print_warning("cannot read log");
> return !stop_on_read_error;
> }
> +
> + /* If not obfuscating, just copy the log as it is */
> + if (!obfuscate)
> + goto done;
> +
> + dirty = xlog_is_dirty(mp, &x, 0);
> +
> + switch (dirty) {
> + case 0:
> + /* clear out a clean log */
> + if (show_progress)
> + print_progress("Zeroing clean log");
> + memset(iocur_top->data, 0,
> + mp->m_sb.sb_logblocks * mp->m_sb.sb_blocksize);
> + break;
> + case 1:
> + /* keep the dirty log */
> + if (obfuscate)
The 'if (obfuscate)' checks here and below are pointless with the
!obfuscate bypass above. Seems fine otherwise.
Brian
> + print_warning(
> +_("Filesystem log is dirty; image will contain unobfuscated metadata in log."));
> + break;
> + case -1:
> + /* log detection error */
> + if (obfuscate)
> + print_warning(
> +_("Could not discern log; image will contain unobfuscated metadata in log."));
> + break;
> + }
> +
> +done:
> return !write_buf(iocur_top);
> }
>
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2015-06-08 18:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 19:02 [PATCH 0/4] xfsprogs: mini patch-bomb Eric Sandeen
2015-05-29 19:03 ` [PATCH 1/4] xfsprogs: remove unused write-only var l_logsize Eric Sandeen
2015-06-03 17:11 ` Brian Foster
2015-05-29 19:06 ` [PATCH 2/4] xfsprogs: add xlog_is_empty() helper Eric Sandeen
2015-06-03 17:11 ` Brian Foster
2015-05-29 19:13 ` [PATCH 3/4] xfsprogs: rename dont_obfuscate in xfs_metadump Eric Sandeen
2015-06-03 17:11 ` Brian Foster
2015-05-29 19:17 ` [PATCH 4/4] xfsprogs: zero out clean log " Eric Sandeen
2015-06-03 17:11 ` Brian Foster
2015-06-03 20:01 ` Eric Sandeen
2015-06-08 15:06 ` [PATCH 4/4 V2] " Eric Sandeen
2015-06-08 18:29 ` Brian Foster [this message]
2015-06-08 18:32 ` Eric Sandeen
2015-06-09 23:35 ` Dave Chinner
2015-06-08 18:46 ` [PATCH 4/4 V3] " Eric Sandeen
2015-06-08 18:50 ` Brian Foster
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=20150608182947.GA18211@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=sandeen@redhat.com \
--cc=sandeen@sandeen.net \
--cc=xfs@oss.sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.