Open segment file before using it
logfs_recover_sb() needs it open.
Signed-off-by: Joern Engel <joern@logfs.org>
diff --git a/fs/logfs/super.c b/fs/logfs/super.c
index c66beab..0187281 100644
--- a/fs/logfs/super.c
+++ b/fs/logfs/super.c
@@ -289,6 +289,10 @@
{
int err;
+ err = logfs_open_segfile(sb);
+ if (err)
+ return err;
+
/* Repair any broken superblock copies */
err = logfs_recover_sb(sb);
if (err)
@@ -299,10 +303,6 @@
if (err)
return err;
- err = logfs_open_segfile(sb);
- if (err)
- return err;
-
/* Do one GC pass before any data gets dirtied */
logfs_gc_pass(sb);