aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ext2fs/openfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ext2fs/openfs.c')
-rw-r--r--lib/ext2fs/openfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index d483bd95..113b80e7 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -391,9 +391,6 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
ext2fs_mark_super_dirty(fs);
}
- fs->flags &= ~EXT2_FLAG_NOFREE_ON_ERROR;
- *ret_fs = fs;
-
if ((fs->super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_MMP) &&
!(flags & EXT2_FLAG_SKIP_MMP) &&
(flags & (EXT2_FLAG_RW | EXT2_FLAG_EXCLUSIVE))) {
@@ -405,6 +402,9 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
}
}
+ fs->flags &= ~EXT2_FLAG_NOFREE_ON_ERROR;
+ *ret_fs = fs;
+
return 0;
cleanup:
if (flags & EXT2_FLAG_NOFREE_ON_ERROR)