Skip to contentSkip to conversation

xfs_metadump: don't zero log if not obfuscating

PATCH In review Eric Sandeen 2 participants 2 messages Jun 22, 2015 – Jun 24, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_metadump: don't zero log if not obfuscating

The earlier commit:

ec693e1 metadump: zero out clean log

ignored the "obfuscate" state, but there's no reason to zero out the log if we're not obfuscating; all the other metadata is in the clear, so we may as well keep it around in the log as well.

---

(this is for the progs-misc-fixes-1 branch)

db/metadump.c +7 -4
index eb5e9da..bdc48a0 100644
@@ -2184,6 +2184,10 @@ copy_log(void)
 		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) {
@@ -2196,18 +2200,17 @@ copy_log(void)
 		break;
 	case 1:
 		/* keep the dirty log */
-		if (obfuscate)
-			print_warning(
+		print_warning(
 _("Filesystem log is dirty; image will contain unobfuscated metadata in log."));
 		break;
 	case -1:
 		/* log detection error */
-		if (obfuscate)
-			print_warning(
+		print_warning(
 _("Could not discern log; image will contain unobfuscated metadata in log."));
 		break;
 	}
 
+done:
 	return !write_buf(iocur_top);
 }
 

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Eric Sandeen

The earlier commit:

ec693e1 metadump: zero out clean log

ignored the "obfuscate" state, but there's no reason to zero out the log if we're not obfuscating; all the other metadata is in the clear, so we may as well keep it around in the log as well.

---

Quoted 42 lines

(this is for the progs-misc-fixes-1 branch)

db/metadump.c +7 -4
index eb5e9da..bdc48a0 100644
@@ -2184,6 +2184,10 @@ copy_log(void)
 		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) {
@@ -2196,18 +2200,17 @@ copy_log(void)
 		break;
 	case 1:
 		/* keep the dirty log */
-		if (obfuscate)
-			print_warning(
+		print_warning(
 _("Filesystem log is dirty; image will contain unobfuscated metadata in log."));
 		break;
 	case -1:
 		/* log detection error */
-		if (obfuscate)
-			print_warning(
+		print_warning(
 _("Could not discern log; image will contain unobfuscated metadata in log."));
 		break;
 	}
 
+done:
 	return !write_buf(iocur_top);
 }
 
Quoted 4 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs