@@ -1398,6 +1398,21 @@ static int journal_get_superblock(journal_t *journal)
1398
1398
goto out ;
1399
1399
}
1400
1400
1401
+ /*
1402
+ * If this is a V2 superblock, then we have to check the
1403
+ * features flags on it.
1404
+ */
1405
+ if (!jbd2_format_support_feature (journal ))
1406
+ return 0 ;
1407
+
1408
+ if ((sb -> s_feature_ro_compat &
1409
+ ~cpu_to_be32 (JBD2_KNOWN_ROCOMPAT_FEATURES )) ||
1410
+ (sb -> s_feature_incompat &
1411
+ ~cpu_to_be32 (JBD2_KNOWN_INCOMPAT_FEATURES ))) {
1412
+ printk (KERN_WARNING "JBD2: Unrecognised features on journal\n" );
1413
+ goto out ;
1414
+ }
1415
+
1401
1416
if (jbd2_has_feature_csum2 (journal ) &&
1402
1417
jbd2_has_feature_csum3 (journal )) {
1403
1418
/* Can't have checksum v2 and v3 at the same time! */
@@ -2059,21 +2074,6 @@ int jbd2_journal_load(journal_t *journal)
2059
2074
int err ;
2060
2075
journal_superblock_t * sb = journal -> j_superblock ;
2061
2076
2062
- /*
2063
- * If this is a V2 superblock, then we have to check the
2064
- * features flags on it.
2065
- */
2066
- if (jbd2_format_support_feature (journal )) {
2067
- if ((sb -> s_feature_ro_compat &
2068
- ~cpu_to_be32 (JBD2_KNOWN_ROCOMPAT_FEATURES )) ||
2069
- (sb -> s_feature_incompat &
2070
- ~cpu_to_be32 (JBD2_KNOWN_INCOMPAT_FEATURES ))) {
2071
- printk (KERN_WARNING
2072
- "JBD2: Unrecognised features on journal\n" );
2073
- return - EINVAL ;
2074
- }
2075
- }
2076
-
2077
2077
/*
2078
2078
* Create a slab for this blocksize
2079
2079
*/
0 commit comments