summaryrefslogtreecommitdiffstats
path: root/e2fsprogs-1.41.4-fix-external-journals.patch
blob: 28bb8f0a20e4899508b37e1ccede2b54e685a988 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From: Theodore Ts'o <tytso@mit.edu>
Date: Tue, 17 Mar 2009 02:16:44 +0000 (-0400)
Subject: libext2fs: external journal devices should not cause ext2fs_open2 to fail
X-Git-Url: http://git.kernel.org/?p=fs%2Fext2%2Fe2fsprogs.git;a=commitdiff_plain;h=341b52dfa8c2afc11d8410de9bd381b03e75c6af

libext2fs: external journal devices should not cause ext2fs_open2 to fail

This fixes a regression introduced in commit 79a9ab14 which caused
attempts to open external journals to fail due to overly strict
filesystem consistency checks.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---

diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index cdfeaec..f6fe3f0 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -243,10 +243,6 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
 		goto cleanup;
 	}
 	fs->fragsize = EXT2_FRAG_SIZE(fs->super);
-       if (EXT2_INODES_PER_GROUP(fs->super) == 0) {
-		retval = EXT2_ET_CORRUPT_SUPERBLOCK;
-		goto cleanup;
-	}
 	fs->inode_blocks_per_group = ((EXT2_INODES_PER_GROUP(fs->super) *
 				       EXT2_INODE_SIZE(fs->super) +
 				       EXT2_BLOCK_SIZE(fs->super) - 1) /
@@ -273,6 +269,11 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
 		return 0;
 	}
 
+	if (EXT2_INODES_PER_GROUP(fs->super) == 0) {
+		retval = EXT2_ET_CORRUPT_SUPERBLOCK;
+		goto cleanup;
+	}
+
 	/*
 	 * Read group descriptors
 	 */