xfs_metadump: don't warn about unobfuscated log with -o
diff mbox

Message ID 541974d2-5877-a7ef-af3c-7d1a47e227c0@sandeen.net
State Accepted
Headers show

Commit Message

Eric Sandeen Aug. 4, 2016, 3:51 p.m. UTC
It makes no sense to warn about un-obfuscated logs
when we asked xfs_metadump to not obfuscate metadata:

# xfs_metadump -o /dev/loop2 bad.metadump
xfs_metadump: Filesystem log is dirty; image will contain unobfuscated metadata in log.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Comments

Bill O'Donnell Aug. 4, 2016, 4:13 p.m. UTC | #1
On Thu, Aug 04, 2016 at 10:51:12AM -0500, Eric Sandeen wrote:
> It makes no sense to warn about un-obfuscated logs
> when we asked xfs_metadump to not obfuscate metadata:
> 
> # xfs_metadump -o /dev/loop2 bad.metadump
> xfs_metadump: Filesystem log is dirty; image will contain unobfuscated metadata in log.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
> ---
> 
> diff --git a/db/metadump.c b/db/metadump.c
> index d7ff6e5..01a51c4 100644
> --- a/db/metadump.c
> +++ b/db/metadump.c
> @@ -2575,12 +2575,14 @@ copy_log(void)
>  		break;
>  	case 1:
>  		/* keep the dirty log */
> -		print_warning(
> +		if (obfuscate)
> +			print_warning(
>  _("Filesystem log is dirty; image will contain unobfuscated metadata in log."));
>  		break;
>  	case -1:
>  		/* log detection error */
> -		print_warning(
> +		if (obfuscate)
> +			print_warning(
>  _("Could not discern log; image will contain unobfuscated metadata in log."));
>  		break;
>  	}
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

Patch
diff mbox

diff --git a/db/metadump.c b/db/metadump.c
index d7ff6e5..01a51c4 100644
--- a/db/metadump.c
+++ b/db/metadump.c
@@ -2575,12 +2575,14 @@  copy_log(void)
 		break;
 	case 1:
 		/* keep the dirty log */
-		print_warning(
+		if (obfuscate)
+			print_warning(
 _("Filesystem log is dirty; image will contain unobfuscated metadata in log."));
 		break;
 	case -1:
 		/* log detection error */
-		print_warning(
+		if (obfuscate)
+			print_warning(
 _("Could not discern log; image will contain unobfuscated metadata in log."));
 		break;
 	}