Skip to contentSkip to conversation

reiser4progs: Grab pset after skipping the semantic pass by fsck

PATCH New Edward Shishkin 1 participant 1 message Aug 25, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reiser4progs: Grab pset after skipping the semantic pass by fsck

Init global pset in the case when semantic pass is skipped because of fatal corruptions. Otherwise fsck segfaults on volumes of format versions 4.0.1 when reopening a backup at fsck_check_fini().

---
 librepair/repair.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
librepair/repair.c +7 -1
@@ -786,8 +786,14 @@ errno_t repair_check(repair_data_t *repa
 	if (repair->fatal) {
 		aal_warn("Fatal corruptions were found. "
 			 "Semantic pass is skipped.");
+		/*
+		 * We need to prepare pset for backup
+		 * creation in fsck_check_fini().
+		 */
+		if (res = reiser4_pset_tree(control.repair->fs->tree, 0))
+			goto error;
 		goto update;
-	} 
+	}
 	
 	/* Check the semantic reiser4 tree. */
 	if ((res = repair_sem_prepare(&control, &sem)))