Commit 0076493
ext4: initialize multi-block allocator before checking block descriptors
With EXT4FS_DEBUG ext4_count_free_clusters() will call
ext4_read_block_bitmap() without s_group_info initialized, so we need to
initialize multi-block allocator before.
And dependencies that must be solved, to allow this:
- multi-block allocator needs in group descriptors
- need to install s_op before initializing multi-block allocator,
because in ext4_mb_init_backend() new inode is created.
- initialize number of group desc blocks (s_gdb_count) otherwise
number of clusters returned by ext4_free_clusters_after_init() is not correct.
(see ext4_bg_num_gdb_nometa())
Here is the stack backtrace:
(gdb) bt
#0 ext4_get_group_info (group=0, sb=0xffff880079a10000) at ext4.h:2430
#1 ext4_validate_block_bitmap (sb=sb@entry=0xffff880079a10000,
desc=desc@entry=0xffff880056510000, block_group=block_group@entry=0,
bh=bh@entry=0xffff88007bf2b2d8) at balloc.c:358
CyanogenMod#2 0xffffffff81232202 in ext4_wait_block_bitmap (sb=sb@entry=0xffff880079a10000,
block_group=block_group@entry=0,
bh=bh@entry=0xffff88007bf2b2d8) at balloc.c:476
CyanogenMod#3 0xffffffff81232eaf in ext4_read_block_bitmap (sb=sb@entry=0xffff880079a10000,
block_group=block_group@entry=0) at balloc.c:489
CyanogenMod#4 0xffffffff81232fc0 in ext4_count_free_clusters (sb=sb@entry=0xffff880079a10000) at balloc.c:665
CyanogenMod#5 0xffffffff81259ffa in ext4_check_descriptors (first_not_zeroed=<synthetic pointer>,
sb=0xffff880079a10000) at super.c:2143
coolya#6 ext4_fill_super (sb=sb@entry=0xffff880079a10000, data=<optimized out>,
data@entry=0x0 <irq_stack_union>, silent=silent@entry=0) at super.c:3851
...
Signed-off-by: Azat Khuzhin <a3at.mail@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>1 parent 4adb6ab commit 0076493
1 file changed
Lines changed: 27 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3869 | 3869 | | |
3870 | 3870 | | |
3871 | 3871 | | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
| 3887 | + | |
| 3888 | + | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
3872 | 3892 | | |
3873 | 3893 | | |
3874 | | - | |
| 3894 | + | |
3875 | 3895 | | |
3876 | 3896 | | |
3877 | 3897 | | |
3878 | 3898 | | |
3879 | 3899 | | |
3880 | 3900 | | |
3881 | | - | |
| 3901 | + | |
3882 | 3902 | | |
3883 | 3903 | | |
3884 | | - | |
3885 | 3904 | | |
3886 | 3905 | | |
3887 | 3906 | | |
| |||
3916 | 3935 | | |
3917 | 3936 | | |
3918 | 3937 | | |
3919 | | - | |
3920 | | - | |
3921 | | - | |
3922 | | - | |
3923 | | - | |
3924 | | - | |
3925 | | - | |
3926 | | - | |
3927 | 3938 | | |
3928 | 3939 | | |
3929 | 3940 | | |
| |||
4113 | 4124 | | |
4114 | 4125 | | |
4115 | 4126 | | |
4116 | | - | |
| 4127 | + | |
4117 | 4128 | | |
4118 | 4129 | | |
4119 | 4130 | | |
4120 | 4131 | | |
4121 | 4132 | | |
4122 | 4133 | | |
4123 | | - | |
4124 | | - | |
4125 | | - | |
4126 | | - | |
4127 | | - | |
4128 | | - | |
4129 | | - | |
4130 | | - | |
4131 | 4134 | | |
4132 | 4135 | | |
4133 | 4136 | | |
| |||
4204 | 4207 | | |
4205 | 4208 | | |
4206 | 4209 | | |
4207 | | - | |
4208 | | - | |
4209 | | - | |
4210 | 4210 | | |
4211 | | - | |
| 4211 | + | |
4212 | 4212 | | |
4213 | 4213 | | |
4214 | 4214 | | |
| |||
4232 | 4232 | | |
4233 | 4233 | | |
4234 | 4234 | | |
| 4235 | + | |
| 4236 | + | |
4235 | 4237 | | |
4236 | 4238 | | |
4237 | 4239 | | |
4238 | 4240 | | |
4239 | 4241 | | |
| 4242 | + | |
4240 | 4243 | | |
4241 | 4244 | | |
4242 | 4245 | | |
| |||
0 commit comments