Skip to content

Commit

Permalink
Revert "quota_tree: Avoid dynamic memory allocations"
Browse files Browse the repository at this point in the history
This reverts commit f16b4c0.

This causes occasional stack overflows with F2FS:

Insufficient stack space to handle exception!
ESR: 0x96000047 -- DABT (current EL)
FAR: 0xffffff8021c47fc0
Task stack:     [0xffffff8021c48000..0xffffff8021c4c000]
IRQ stack:      [0xffffff8010020000..0xffffff8010024000]
Overflow stack: [0xffffffdbfd7c50c0..0xffffffdbfd7c60c0]
CPU: 4 PID: 3231 Comm: Binder:970_8 Tainted: G S              4.14.191-Proton-g3a59fd0b #2036
Hardware name: Qualcomm Technologies, Inc. SM8150 V2 PM8150 KIRIN MP (DT)
task: 0000000069372be4 task.stack: 00000000e3b56b7b
pc : kmem_cache_alloc+0x0/0x1c0
lr : mempool_alloc_slab+0x18/0x20
sp : ffffff8021c48010 pstate : 804001c5
x29: ffffff8021c48010 x28: 0000000000000000
x27: 0000000000000000 x26: ffffffda901e9260
x25: ffffff91b0a8f400 x24: 0000000001080020
x23: ffffff91b260d000 x22: 0000000001091220
x21: 0000000001091220 x20: 0000000000000002
x19: ffffffdbf0dbb380 x18: 0000000000000001
x17: ffffffbf68cc1c00 x16: 0000000000000008
x15: ffffffbf66000000 x14: 0000000000000000
x13: 0000000000000400 x12: ffffffdb728c3000
x11: 0000000000000002 x10: 0000000000000080
x9 : 0000000000000000 x8 : ffffffda901e92f8
x7 : 0000000000000000 x6 : 000000000000003f
x5 : ffffff91b0a8f400 x4 : 0000000001080020
x3 : 0000000000000000 x2 : 0000000001091220
x1 : 0000000001091220 x0 : ffffffdbf4403d00

PC: 0xffffff91b07eede0:
ede0  aa0103e0 d65f03c0 00000000 00000000 00000000 00000000 00000000 00000000
ee00  aa0103e0 d65f03c0 00000000 00000000 00000000 00000000 00000000 00000000
ee20  a9bb7bfd 910003fd a90153f3 aa0003f4 d5384113 a9025bf5 f9001bf7 2a0103f7
ee40  b4000a00 b9404a60 11000400 b9004a60 f9400280 d538d081 91002000 f8616816

LR: 0xffffff91b079ef98:
ef98  2a0003e4 2a0403e0 a8c17bfd d65f03c0 2a0403e0 d65f03c0 d4210000 00000000
efb8  00000000 00000000 a9bf7bfd 2a0003e2 aa0103e0 910003fd 2a0203e1 94013f93
efd8  a8c17bfd d65f03c0 a9bf7bfd 2a0003e2 aa0103e0 910003fd 2a0203e1 9401425b
eff8  a8c17bfd d65f03c0 b4000340 a9be7bfd 910003fd f9000bf3 aa0003f3 b9400801

SP: 0xffffff8021c47fd0:
7fd0  ******** ******** ******** ******** ******** ******** ******** ********
7ff0  ******** ******** ******** ******** 57ac6e9d 00000000 00000000 00000000
8010  21c48020 ffffff80 b079f50c ffffff91 21c480a0 ffffff80 b0a8f474 ffffff91
8030  00000002 00000000 00000002 00000000 00000fe0 00000000 00000080 00000000

Kernel panic - not syncing: kernel stack overflow
CPU: 4 PID: 3231 Comm: Binder:970_8 Tainted: G S              4.14.191-Proton-g3a59fd0b #2036
Hardware name: Qualcomm Technologies, Inc. SM8150 V2 PM8150 KIRIN MP (DT)
Call trace:
 dump_backtrace+0x0/0x1e0
 show_stack+0x14/0x20
 dump_stack+0x94/0xd4
 panic+0x130/0x2b0
 nmi_panic+0x68/0x80
 handle_bad_stack+0x104/0x12c
 __bad_stack+0x88/0x8c
 kmem_cache_alloc+0x0/0x1c0
 mempool_alloc+0xec/0x1a0
 sg_pool_alloc+0x74/0x80
 __sg_alloc_table+0x110/0x160
 sg_alloc_table_chained+0x9c/0xe0
 scsi_init_io+0x44/0x220
 sd_init_command+0x118/0xa40
 scsi_setup_cmnd+0x68/0x120
 scsi_prep_fn+0x54/0x200
 blk_peek_request+0x16c/0x260
 scsi_request_fn+0x48/0x620
 __blk_run_queue+0x40/0x80
 cfq_insert_request+0x364/0x600
 __elv_add_request+0x2b0/0x320
 blk_queue_bio+0x37c/0x3e0
 generic_make_request+0xa4/0x340
 submit_bio+0x38/0x160
 __submit_bio+0x194/0x260
 __submit_merged_write_cond+0x180/0x320
 f2fs_submit_merged_write_cond+0x10/0x20
 f2fs_wait_on_page_writeback+0x6c/0x100
 f2fs_write_begin+0x2bc/0xd00
 f2fs_quota_write+0xa0/0x240
 remove_tree+0x3c4/0x920
 remove_tree+0x10c/0x920
 remove_tree+0x10c/0x920
 remove_tree+0x10c/0x920
 qtree_release_dquot+0x80/0xa0
 v2_release_dquot+0x3c/0x60
 dquot_release+0x60/0xe0
 f2fs_dquot_release+0x30/0x80
 dqput.part.0+0x94/0x260
 dquot_get_dqblk+0xb0/0xe0
 SyS_quotactl+0x6e4/0x2280
 el0_svc_naked+0x34/0x38

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
  • Loading branch information
kdrag0n committed Oct 28, 2020
1 parent fa8e9c2 commit 2302c12
Showing 1 changed file with 87 additions and 92 deletions.
Loading

0 comments on commit 2302c12

Please sign in to comment.