@@ -1525,8 +1525,6 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
1525
1525
arg = JBD2_DEFAULT_MAX_COMMIT_AGE ;
1526
1526
sbi -> s_commit_interval = HZ * arg ;
1527
1527
} else if (token == Opt_max_batch_time ) {
1528
- if (arg == 0 )
1529
- arg = EXT4_DEF_MAX_BATCH_TIME ;
1530
1528
sbi -> s_max_batch_time = arg ;
1531
1529
} else if (token == Opt_min_batch_time ) {
1532
1530
sbi -> s_min_batch_time = arg ;
@@ -2809,10 +2807,11 @@ static void print_daily_error_info(unsigned long arg)
2809
2807
es = sbi -> s_es ;
2810
2808
2811
2809
if (es -> s_error_count )
2812
- ext4_msg (sb , KERN_NOTICE , "error count: %u" ,
2810
+ /* fsck newer than v1.41.13 is needed to clean this condition. */
2811
+ ext4_msg (sb , KERN_NOTICE , "error count since last fsck: %u" ,
2813
2812
le32_to_cpu (es -> s_error_count ));
2814
2813
if (es -> s_first_error_time ) {
2815
- printk (KERN_NOTICE "EXT4-fs (%s): initial error at %u: %.*s:%d" ,
2814
+ printk (KERN_NOTICE "EXT4-fs (%s): initial error at time %u: %.*s:%d" ,
2816
2815
sb -> s_id , le32_to_cpu (es -> s_first_error_time ),
2817
2816
(int ) sizeof (es -> s_first_error_func ),
2818
2817
es -> s_first_error_func ,
@@ -2826,7 +2825,7 @@ static void print_daily_error_info(unsigned long arg)
2826
2825
printk ("\n" );
2827
2826
}
2828
2827
if (es -> s_last_error_time ) {
2829
- printk (KERN_NOTICE "EXT4-fs (%s): last error at %u: %.*s:%d" ,
2828
+ printk (KERN_NOTICE "EXT4-fs (%s): last error at time %u: %.*s:%d" ,
2830
2829
sb -> s_id , le32_to_cpu (es -> s_last_error_time ),
2831
2830
(int ) sizeof (es -> s_last_error_func ),
2832
2831
es -> s_last_error_func ,
@@ -3880,38 +3879,19 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
3880
3879
goto failed_mount2 ;
3881
3880
}
3882
3881
}
3883
-
3884
- /*
3885
- * set up enough so that it can read an inode,
3886
- * and create new inode for buddy allocator
3887
- */
3888
- sbi -> s_gdb_count = db_count ;
3889
- if (!test_opt (sb , NOLOAD ) &&
3890
- EXT4_HAS_COMPAT_FEATURE (sb , EXT4_FEATURE_COMPAT_HAS_JOURNAL ))
3891
- sb -> s_op = & ext4_sops ;
3892
- else
3893
- sb -> s_op = & ext4_nojournal_sops ;
3894
-
3895
- ext4_ext_init (sb );
3896
- err = ext4_mb_init (sb );
3897
- if (err ) {
3898
- ext4_msg (sb , KERN_ERR , "failed to initialize mballoc (%d)" ,
3899
- err );
3900
- goto failed_mount2 ;
3901
- }
3902
-
3903
3882
if (!ext4_check_descriptors (sb , & first_not_zeroed )) {
3904
3883
ext4_msg (sb , KERN_ERR , "group descriptors corrupted!" );
3905
- goto failed_mount2a ;
3884
+ goto failed_mount2 ;
3906
3885
}
3907
3886
if (EXT4_HAS_INCOMPAT_FEATURE (sb , EXT4_FEATURE_INCOMPAT_FLEX_BG ))
3908
3887
if (!ext4_fill_flex_info (sb )) {
3909
3888
ext4_msg (sb , KERN_ERR ,
3910
3889
"unable to initialize "
3911
3890
"flex_bg meta info!" );
3912
- goto failed_mount2a ;
3891
+ goto failed_mount2 ;
3913
3892
}
3914
3893
3894
+ sbi -> s_gdb_count = db_count ;
3915
3895
get_random_bytes (& sbi -> s_next_generation , sizeof (u32 ));
3916
3896
spin_lock_init (& sbi -> s_next_gen_lock );
3917
3897
@@ -3946,6 +3926,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
3946
3926
sbi -> s_stripe = ext4_get_stripe_size (sbi );
3947
3927
sbi -> s_extent_max_zeroout_kb = 32 ;
3948
3928
3929
+ /*
3930
+ * set up enough so that it can read an inode
3931
+ */
3932
+ if (!test_opt (sb , NOLOAD ) &&
3933
+ EXT4_HAS_COMPAT_FEATURE (sb , EXT4_FEATURE_COMPAT_HAS_JOURNAL ))
3934
+ sb -> s_op = & ext4_sops ;
3935
+ else
3936
+ sb -> s_op = & ext4_nojournal_sops ;
3949
3937
sb -> s_export_op = & ext4_export_ops ;
3950
3938
sb -> s_xattr = ext4_xattr_handlers ;
3951
3939
#ifdef CONFIG_QUOTA
@@ -4135,13 +4123,21 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
4135
4123
if (err ) {
4136
4124
ext4_msg (sb , KERN_ERR , "failed to reserve %llu clusters for "
4137
4125
"reserved pool" , ext4_calculate_resv_clusters (sb ));
4138
- goto failed_mount5 ;
4126
+ goto failed_mount4a ;
4139
4127
}
4140
4128
4141
4129
err = ext4_setup_system_zone (sb );
4142
4130
if (err ) {
4143
4131
ext4_msg (sb , KERN_ERR , "failed to initialize system "
4144
4132
"zone (%d)" , err );
4133
+ goto failed_mount4a ;
4134
+ }
4135
+
4136
+ ext4_ext_init (sb );
4137
+ err = ext4_mb_init (sb );
4138
+ if (err ) {
4139
+ ext4_msg (sb , KERN_ERR , "failed to initialize mballoc (%d)" ,
4140
+ err );
4145
4141
goto failed_mount5 ;
4146
4142
}
4147
4143
@@ -4218,8 +4214,11 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
4218
4214
failed_mount7 :
4219
4215
ext4_unregister_li_request (sb );
4220
4216
failed_mount6 :
4221
- ext4_release_system_zone (sb );
4217
+ ext4_mb_release (sb );
4222
4218
failed_mount5 :
4219
+ ext4_ext_release (sb );
4220
+ ext4_release_system_zone (sb );
4221
+ failed_mount4a :
4223
4222
dput (sb -> s_root );
4224
4223
sb -> s_root = NULL ;
4225
4224
failed_mount4 :
@@ -4243,14 +4242,11 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
4243
4242
percpu_counter_destroy (& sbi -> s_extent_cache_cnt );
4244
4243
if (sbi -> s_mmp_tsk )
4245
4244
kthread_stop (sbi -> s_mmp_tsk );
4246
- failed_mount2a :
4247
- ext4_mb_release (sb );
4248
4245
failed_mount2 :
4249
4246
for (i = 0 ; i < db_count ; i ++ )
4250
4247
brelse (sbi -> s_group_desc [i ]);
4251
4248
ext4_kvfree (sbi -> s_group_desc );
4252
4249
failed_mount :
4253
- ext4_ext_release (sb );
4254
4250
if (sbi -> s_chksum_driver )
4255
4251
crypto_free_shash (sbi -> s_chksum_driver );
4256
4252
if (sbi -> s_proc ) {
0 commit comments