android_kernel_samsung_a7y1.../fs/ext4
Shijie Luo 332d9f14c1 ext4: add cond_resched() to __ext4_find_entry()
commit 9424ef56e13a1f14c57ea161eed3ecfdc7b2770e upstream.

We tested a soft lockup problem in linux 4.19 which could also
be found in linux 5.x.

When dir inode takes up a large number of blocks, and if the
directory is growing when we are searching, it's possible the
restart branch could be called many times, and the do while loop
could hold cpu a long time.

Here is the call trace in linux 4.19.

[  473.756186] Call trace:
[  473.756196]  dump_backtrace+0x0/0x198
[  473.756199]  show_stack+0x24/0x30
[  473.756205]  dump_stack+0xa4/0xcc
[  473.756210]  watchdog_timer_fn+0x300/0x3e8
[  473.756215]  __hrtimer_run_queues+0x114/0x358
[  473.756217]  hrtimer_interrupt+0x104/0x2d8
[  473.756222]  arch_timer_handler_virt+0x38/0x58
[  473.756226]  handle_percpu_devid_irq+0x90/0x248
[  473.756231]  generic_handle_irq+0x34/0x50
[  473.756234]  __handle_domain_irq+0x68/0xc0
[  473.756236]  gic_handle_irq+0x6c/0x150
[  473.756238]  el1_irq+0xb8/0x140
[  473.756286]  ext4_es_lookup_extent+0xdc/0x258 [ext4]
[  473.756310]  ext4_map_blocks+0x64/0x5c0 [ext4]
[  473.756333]  ext4_getblk+0x6c/0x1d0 [ext4]
[  473.756356]  ext4_bread_batch+0x7c/0x1f8 [ext4]
[  473.756379]  ext4_find_entry+0x124/0x3f8 [ext4]
[  473.756402]  ext4_lookup+0x8c/0x258 [ext4]
[  473.756407]  __lookup_hash+0x8c/0xe8
[  473.756411]  filename_create+0xa0/0x170
[  473.756413]  do_mkdirat+0x6c/0x140
[  473.756415]  __arm64_sys_mkdirat+0x28/0x38
[  473.756419]  el0_svc_common+0x78/0x130
[  473.756421]  el0_svc_handler+0x38/0x78
[  473.756423]  el0_svc+0x8/0xc
[  485.755156] watchdog: BUG: soft lockup - CPU#2 stuck for 22s! [tmp:5149]

Add cond_resched() to avoid soft lockup and to provide a better
system responding.

Link: https://lore.kernel.org/r/20200215080206.13293-1-luoshijie1@huawei.com
Signed-off-by: Shijie Luo <luoshijie1@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 14:03:43 +02:00
..
sdp
acl.c
acl.h
balloc.c
bitmap.c
block_validity.c
crypto_fname.c
crypto_key.c
crypto_policy.c fscrypt: don't set policy for a dead directory 2020-04-06 19:29:02 +02:00
crypto.c
dir.c ext4: fix checksum errors with indexed dirs 2020-04-07 13:55:12 +02:00
ext4_crypto.h
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h ext4: fix NULL pointer dereference while journal is aborted 2020-04-06 10:58:15 +02:00
ext4.h ext4: fix a data race in EXT4_I(inode)->i_disksize 2020-04-07 14:03:41 +02:00
extents_status.c
extents_status.h
extents.c
file.c ext4: fix data corruption caused by unaligned direct AIO 2020-04-06 10:58:16 +02:00
fscrypt_knox_private.h
fsync.c
hash.c
ialloc.c
indirect.c ext4: cleanup bh release code in ext4_ind_remove_space() 2020-04-06 13:43:42 +02:00
inline.c ext4: set error return correctly when ext4_htree_store_dirent fails 2020-04-07 13:42:46 +02:00
inode.c ext4: fix a data race in EXT4_I(inode)->i_disksize 2020-04-07 14:03:41 +02:00
ioctl.c ext4: actually request zeroing of inode table after grow 2020-04-06 18:12:36 +02:00
Kconfig
Makefile
mballoc.c
mballoc.h
migrate.c
mmp.c
move_extent.c
namei.c ext4: add cond_resched() to __ext4_find_entry() 2020-04-07 14:03:43 +02:00
page-io.c
readpage.c
resize.c ext4: report real fs size after failed resize 2020-04-06 15:16:53 +02:00
super.c ext4: add more paranoia checking in ext4_expand_extra_isize handling 2020-04-07 13:36:38 +02:00
symlink.c
sysfs.c
truncate.h
xattr_security.c
xattr_trusted.c
xattr_user.c
xattr.c
xattr.h